askmike / bitstamp

Bitstamp REST API wrapper
81 stars 54 forks source link

When rate limited the message is not passed to the API user #52

Open jopann opened 6 years ago

jopann commented 6 years ago

When too many calls are made to the private API, Bitstamp will temporarily block the requests and inform us of it.

In Bitstamp.prototype._request:

the res.StatusCode is 200, however the buffer cannot be parsed as JSON. This results in messages like "SyntaxError: Unexpected token . in JSON at position 6" being passed as the error to the API callback.

Instead can we either return a BitstampError with the raw buffer text or include the raw buffer text in some other way.

jopann commented 6 years ago

When this happens, the buffer we get back is something like "10.10.10.10 blocked for 900 seconds"