Skip to content

Commit edeedd2

Browse files
committed
Merge pull request #190 from russelldavis/fix-onerror
Fix onerror handling when the browser passes an exception arg.
2 parents e1c1cc7 + d301274 commit edeedd2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

vendor/TraceKit/tracekit.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,15 @@ TraceKit.report = (function reportModuleWrapper() {
148148
function traceKitWindowOnError(message, url, lineNo, colNo, ex) {
149149
var stack = null;
150150

151-
if (!isUndefined(ex)) {
151+
if (lastExceptionStack) {
152+
TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);
153+
processLastException();
154+
} else if (ex) {
152155
// New chrome and blink send along a real error object
153156
// Let's just report that like a normal error.
154157
// See: https://mikewest.org/2013/08/debugging-runtime-errors-with-window-onerror
155-
report(ex, false);
156-
} else if (lastExceptionStack) {
157-
TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message);
158-
processLastException();
158+
stack = TraceKit.computeStackTrace(ex);
159+
notifyHandlers(stack, true);
159160
} else {
160161
var location = {
161162
'url': url,

0 commit comments

Comments
 (0)