Skip to content

DOMError is captured as [object DOMError] #939

@paularmstrong

Description

@paularmstrong

Do you want to request a feature or report a bug?
bug

What is the current behavior?

When a DOMError is thrown, raven-js logs the error as '[object DOMError]' without any proper messaging. reference: https://github.com/getsentry/raven-js/blob/b8afab1d156467cb2cca0a166385fe9a94aff2cb/dist/raven.js#L413

What is the expected behavior?

The DOMError interface is not actually an instance of Error or an Exception and does not include a stacktrace. Since it doesn't pass the isError check, it's converted to a string and is re-thrown.

Our expected behavior would be to pull out the name property and throw/log as DOMError: ${error.name}, so we can have as much context on the error as possible.

Which versions of Raven.js, and which browser and OS are affected by this issue?
Pretty much every version of both.

Did this work in previous versions of Raven.js?
No

Are you using the CDN (http://ravenjs.com)?
No

Are you using hosted Sentry or on-premises?
Hosted

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