askmike/bitstamp

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

jopann opened this issue · 1 comments

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.

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