Skip to content

Generate Errors using classes instead of Structures #1506

@trivikr

Description

@trivikr

Is your feature request related to a problem? Please describe.
We can't use instanceof check on Error shapes, and have to do equality check for string values in err.name
MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Handling_a_specific_error
Refs: #1502 (comment)

Describe the solution you'd like
Enable instanceof check on Errors by using classes on Error shapes instead of Structures

Describe alternatives you've considered
Stick with string checks for Errors, i.e. err.name === "ErrorName"

Metadata

Metadata

Assignees

No one assigned

    Labels

    High Priorityfeature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions