For a while now, I've been bothered by the way the API reports errors.
So I thought about how a general mapping function could look like to encapsulate the design flaw.
I think in other dynamic languages the mapping can be used almost the same way.
If they ever change the API to the http standard, the function is robust and will not break.
I had to remove the source, because the forum does not preserve the spaces.
Here is the working fiddle.
Just replace the 2 value in the env-vars with your api-key.
So I thought about how a general mapping function could look like to encapsulate the design flaw.
I think in other dynamic languages the mapping can be used almost the same way.
If they ever change the API to the http standard, the function is robust and will not break.
I had to remove the source, because the forum does not preserve the spaces.
Here is the working fiddle.
Just replace the 2 value in the env-vars with your api-key.