Skip to content

Add ErrorEvent #58918

Open
Open
@Richienb

Description

@Richienb

What is the problem this feature will solve?

Emitting errors in userspace libraries that use EventTarget.
To emit an error, you would do:

eventTarget.dispatchEvent(new ErrorEvent('error', {error}));

Previous (now-"stale") filing: #47587

What is the feature you are proposing to solve the problem?

Implement the ErrorEvent class from browsers as a Node.js global.

What alternatives have you considered?

Emitting a CustomEvent with:

eventTarget.dispatchEvent(new CustomEvent('error', {detail: {error}}));

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    Status

    Awaiting Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions