krystianity / node-bitstamp

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

Rejecting the Promise when API calls return an error. #15

Closed nicolasgarnier closed 6 years ago

nicolasgarnier commented 6 years ago

fixes #6

tuloski commented 6 years ago

@nicolasgarnier Be careful that not only body.status == "error" means error. Once I got the body only with "error" field (when the API keys doesn't have the permission for that action for example), and probably there are other cases like that. Probably it's an error on bitstamp side.

nicolasgarnier commented 6 years ago

Good feedback. I can add that check just in case although I think in that particular case the HTTP status should be 401 so we'll throw at l.102

johnthillaye commented 6 years ago

Is this getting merged ?

tuloski commented 6 years ago

Is this tested? Can I pull?

krystianity commented 6 years ago

Sry for the long wait guys, I reviewed and will merge asap if possible.

nicolasgarnier commented 6 years ago

done!