Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOMExceptions captured by onunhandledrejection as "Non-Error promise rejection captured with keys: [object has no keys]" #2244

Closed
5 of 9 tasks
dbow opened this issue Sep 16, 2019 · 4 comments

Comments

@dbow
Copy link

dbow commented Sep 16, 2019

Package + Version

  • @sentry/browser
  • @sentry/node
  • raven-js
  • raven-node (raven for node)
  • other:

Version:

^5.6.2

Description

Possibly related to #2210 though I wasn't sure if that was just focused on custom error events

I'm seeing a lot of UnhandledRejection events in our dashboard with the following message: Non-Error promise rejection captured with keys: [object has no keys]. After digging in a bit, it looks like it's mostly DOMExceptions, which don't have a .stack property so they're logged like non-Errors.

It does log the details in the serialized property, for example:

{
message: The play() request was interrupted by a call to pause(). https://goo.gl/LdLk22, 
name: AbortError, 
stack: [undefined]
}

Looks like DOMExceptions were handled in raven-js in this pull request: #1310 Could they be handled similarly gracefully in onunhandledrejection? It seems like various browser things like fetch and even media methods like play() (like the above serialized error) throw DOMException errors, and having them all roll up into that confusing error message makes it tougher to debug.

Here's an example event: https://sentry.io/organizations/salamanca/issues/1146611869/events/fcec1322aca848cd99fc07b52778e20f/
though i think you can repro in chrome console just by doing

window.onunhandledrejection = function(e) {
  console.log(e.reason); // an instance of DOMException
  console.log(e.reason.stack); // this will be undefined
};

Promise.reject(new DOMException()).then(function() {});
@nkov
Copy link

nkov commented Oct 23, 2019

In my case it wasn't a DOMException, it was a preflight OPTIONS request which failed, so the fetch was cancelled and there was an Uncaught (in promise) TypeError: failed to fetch, but I had the same uninformative message as described in this issue.

@Polm90
Copy link

Polm90 commented Oct 24, 2019

In my case was a QuotaExceededError on cordova for iOS

@piotrd
Copy link

piotrd commented May 25, 2020

In my case it was triggered by Grammarly extension only in Safari, macOS.

@kamilogorek
Copy link
Contributor

Closing this, as DOMException are now handled (which was the original OP request).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants