FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Handle different error types · Issue #39 · blakeembrey/javascript-stringify · GitHub

Handle different error types #39

Description

Currently, all error types seem to be represented as new Error(<message>). Other error types like SyntaxError, ReferenceError etc, are not serialized any differently

Suggestion:

stringify(new SyntaxError('syntax')); // "new SyntaxError(syntax')"
stringify(new ReferenceError('syntax')); // "new ReferenceError(syntax')"
...

It should be possible to do this using Error.prototype.name with the caveat that it can be overridden to an empty string, which should probably be handled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL