askmike / bitstamp

Bitstamp REST API wrapper
81 stars 54 forks source link

Fixing double callback on a socket error. req.on 'error' is already c… #35

Closed vaunus closed 7 years ago

vaunus commented 7 years ago

…alled in this instance.

vaunus commented 7 years ago

Hi, please see my PR. It seems that callback() is called twice on connection timeouts resulting in the app crashing and not being able to handle this gracefully up the chain. From what I can tell the req.on 'error' should be sufficient to handle all error cases.

askmike commented 7 years ago

👍

askmike commented 7 years ago

I pushed this to npm as version 1.0.1.