krystianity / node-bitstamp

bitstamp REST and WS API Node.js client :dollar:
MIT License
59 stars 41 forks source link

Empty error #21

Closed tuloski closed 5 years ago

tuloski commented 6 years ago

Very often when there is an error, the promise returns an empty error, but never happened to me before. Is it Bitstamp side or might it be in this: if (response.statusCode < 200 || response.statusCode > 299) { return reject(new Error(body)); } where body is empty and the error is in another field?

adityamertia commented 6 years ago

I see a similar issue reported #18 I tried to replace return reject(new Error(body)); by return reject(body); it does return the error string. For me this happened after recent changes done to the library.

krystianity commented 6 years ago

@tuloski i have added the body state to these rejects in the new 2.1.0 version