Skip to content
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

Made sure not to overwrite original error context #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

irond13
Copy link

@irond13 irond13 commented Aug 7, 2015

This happens in the case of uncaught errors in nested contexts (which are sometimes created by Mongoose, etc). The nested context rethrows the error in its catch block after attaching itself to the error, which is then subsequently caught by the parent context. Without my change the originating context would be overwritten on the error.

This makes Namespace.prototype.fromException not very useful in such cases.

(Running the tests before and after applying my change had the same result, i.e. the same set of failures)

This happens in the case of uncaught errors in nested contexts (which are sometimes created by Mongoose, etc). The nested context rethrows the error in its catch block after attaching itself to the error, which is then subsequently caught by the parent context. Without my change the originating context would be overwritten on the error. 

This makes Namespace.prototype.fromException useless in such cases.
@othiym23
Copy link
Owner

Needs a test and to pass the eslint checks, but aside from that this looks useful. Thanks for your time!

@DarylRoberts
Copy link

might need a 0 or a 1 somewhere

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants