3scale-labs / 3scale_ws_api_for_nodejs

3scale is an API Infrastructure service which handles API Keys, Rate Limiting, Analytics, Billing Payments and Developer Management. Includes a configurable API dashboard and developer portal CMS. More product stuff at http://www.3scale.net/, support information at http://support.3scale.net/.
http://www.3scale.net
MIT License
22 stars 13 forks source link

Error handling #8

Open erhhung opened 10 years ago

erhhung commented 10 years ago

I see that all of the client auth methods are not listening on the https.request 'error' event, and so when a lower level network error occurs, my app has no way of handling the auth failure, and the process just exits. For example, if I'm testing my app behind a firewall proxy, the call will eventually time out:

Error: connect ETIMEDOUT at errnoException (net.js:901:11) at Object.afterConnect as oncomplete

I also see simple error strings being 'throw'n on failures, and my callback has no way to handle those, either, due to the async functions. I know I can use a global unhandledException handler, but that's not recommended.

mpguerra commented 7 years ago

@picsoung same with this one, not sure if related to #36