Fix onerror handling when the browser passes an exception arg. #190
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I haven't had (and may not have for a little while) time to test this much, but the basic idea is:
lastExceptionStack
first. If that exists, we always want to do processLastException, which will use the options that were originally passed viaRaven.wrap
orRaven.context
, and clear the vars related to that so they don't get reused on the next call toTraceKit.report
.ex
rather than!isUndefined(ex)
since browsers will sometimes passnull
(this happens when runningexample/index.html
-- it's this error) and in that case, it makes more sense to fall down to the finalelse
blocknotifyHandlers
directly rather thanreport
. The latter does a bunch of stuff we don't want/need here (including the 2000ms timeout thing). I think this means we can get rid of therethrow
arg on report as well (I think this was the only thing using it).Would also be nice to add some tests that exercise the code path where onerror is called with the exception arg.