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

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

@binarykitchen

Description

@binarykitchen

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);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions