node-continuation-local-storage icon indicating copy to clipboard operation
node-continuation-local-storage copied to clipboard

Made sure not to overwrite original error context

Open irond13 opened this issue 10 years ago • 2 comments
trafficstars

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)

irond13 avatar Aug 07 '15 14:08 irond13

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

othiym23 avatar Jan 29 '16 22:01 othiym23

might need a 0 or a 1 somewhere

DarylRoberts avatar Jun 28 '16 08:06 DarylRoberts