-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback exception handling #176
Comments
We went back and forth on this a few times. Bubbling the exception up will actually cause it to get bubbled up to the send lifecycle event handler, which makes the request get retried on the service a number of times even if it is successful. We had turned on bubbling in #74 but had to revert due to #131. The best way to handle these errors it to use domain support inside of nodejs and allow the domain handler to catch the exception. |
Closing this due to age. We recommend using domains when trying to bubble up errors. If you are having issues getting domains to work properly, please open a new issue for that. Thanks for reporting this. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
If an exception happens in the callback of the request the error is not bubbled up.
I can see in the lib/service.js at the makeRequest method that the callback is registered with the request object.
Is there a way to make the exception within the callback be bubbled up to the function that made the request?
For example:
The exception won't be handled, it will just hang
The text was updated successfully, but these errors were encountered: