Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Add more context when throwing 'Uncaught, unspecified "error" event.' #14415

Closed
binarykitchen opened this issue Apr 3, 2015 · 1 comment
Closed

Comments

@binarykitchen
Copy link

Could you please add more context when throwing this error at
https://github.com/joyent/node/blob/master/lib/events.js#L89

Because like that, it's not very helpful. Sometimes I get these errors when having lots of async operations without having attached an error listener yet. Without knowing the real error it is trying to emit, it is extremely difficult to improve code.

Suggestion is to change this line:

throw Error('Uncaught, unspecified "error" event.');

into something like this:

throw Error('Uncaught, unspecified "error" event. The initial error it was trying to emit was:', arguments);
@jasnell
Copy link
Member

jasnell commented Jun 22, 2015

While I think the change is good, I'm not sure it's a priority for either v0.12 or v0.10. We can pick the iojs change up in the converged stream.

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

No branches or pull requests

4 participants