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

Catch unhandled promise rejection events #72

Closed
jh3141 opened this issue Oct 4, 2017 · 11 comments
Closed

Catch unhandled promise rejection events #72

jh3141 opened this issue Oct 4, 2017 · 11 comments

Comments

@jh3141
Copy link

jh3141 commented Oct 4, 2017

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).

@niemyjski
Copy link
Collaborator

Can you submit a pr for this?

@niemyjski
Copy link
Collaborator

@jh3141 can you submit a pr for this

@ghostd
Copy link
Contributor

ghostd commented Jul 9, 2018

Here is a PR: #73

@ghostd
Copy link
Contributor

ghostd commented Sep 3, 2018

Hi @niemyjski

Can we close this issue and bump the version please? I'd like to update my deps with a version handling the promises.

Thx

@niemyjski
Copy link
Collaborator

@ghostd yes, I'll cut a release. I was just trying to get #68 merged in as well.

@niemyjski
Copy link
Collaborator

Could you please review this as well

@adams-family
Copy link

I confirm that 'Possible unhandled rejections' are still not being caught at this moment. Is there a workaround for this? Thanks.

@niemyjski
Copy link
Collaborator

niemyjski commented Sep 9, 2019 via email

@adams-family
Copy link

Hi Blake,
Sorry for the late answer, I managed to create a demo of my issue.
Just open index.html and look at the F12 console. You'll see a Possible unhandled rejection not being caught by Tracekit.
Maybe it's beacuse of something stupid but it wasn't able to figure it out.
Thanks, Adam

Demo.zip

@erikdubbelboer
Copy link

Since this has been merged is there any plan to tag a new release?

@niemyjski
Copy link
Collaborator

I've pushed this in a release, sorry for the delay: https://github.com/csnover/TraceKit/releases/tag/v0.4.6

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