Skip to content

Add ErrorEvent #58918

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions