-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Support unhandled rejections by default #1242
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏅 🏅 🏅 🏅
awesome, I think this is a great change.
code, tests and docs look good.
we should be clear to specify in the release that when people update, this version may start catching errors that were silently occuring in the background.
docs/usage.rst
Outdated
manually hook into such an event handler and call ``Raven.captureException`` or ``Raven.captureMessage`` | ||
directly. | ||
Most Promise libraries however, have a global hook for capturing unhandled errors. You will need to disable default behaviour | ||
by setting ``captureUnhandledRejections`` option to ``false`` and manually hook into such an event handler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to disable default behaviour
is there harm in leaving it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, but it'll silence the error unless you set Raven.debug = true;
to see the log.
Changed to "you may want to".
docs/usage.rst
Outdated
window.onunhandledrejection = function(evt) { | ||
Raven.captureException(evt.reason); | ||
}; | ||
In this case, you don't need to do anything, we already got you covered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe mention captureUnhandledRejections
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit, i would say "we've" not "we"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. And added this note.
3d4ee5b
to
0cd9086
Compare
@kamilogorek @MaxBittker hey, thanks for this feature! |
Related: #1243 |
This patch breaks our build too as I think there are many users relying on this Library in environments where window is not defined - there should be a check for that, or we should be able to turn it off in |
@f-roland it's possible to turn it off, but it's still not enough since in the unregister function it doesn't check if you turned it off and always accesses the window. |
@ohana54 @f-roland fixed and released patched version. I call it dontdeployonfriday thing :( |
:) No worries, thanks for the quick fix!! |
Fixes: #1070
There are more and more clients asking for this feature.