Skip to content

Catch unhandled promise rejection events #72

@jh3141

Description

@jh3141

Promise rejection events can be caught via the window.onunhandledrejection event. If an exception is thrown during processing of a Promise (either during its initial execution phase or during processing a "then" function attached to it), the Promise is rejected and the "reason" entry in the rejection event will be an Error. reason may also be any other type, as it will be populated with whatever argument is given in calls to the reject function of the Promise handler, so will need to be checked before handling. I'm not sure how TraceKit should behave if it catches an unhandled rejection that is not an Error.

Support for this feature of Promises isn't great yet, but is improving (see http://caniuse.com/#feat=unhandledrejection).

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