Skip to content

Fix parameters to TraceKit.rethrow #315

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,7 @@ var Raven = {
// Store the raw exception object for potential debugging and introspection
lastCapturedException = ex;

// TraceKit.report will re-raise any exception passed to it,
// which means you have to wrap it in try/catch. Instead, we
// can wrap it here and only re-raise if TraceKit.report
// raises an exception different from the one we asked to
// report on.
try {
TraceKit.report(ex, options);
} catch(ex1) {
if(ex !== ex1) {
throw ex1;
}
}
TraceKit.report(ex, options);

return Raven;
},
Expand Down
10 changes: 2 additions & 8 deletions vendor/TraceKit/tracekit.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,9 @@ TraceKit.report = (function reportModuleWrapper() {
/**
* Reports an unhandled Error to TraceKit.
* @param {Error} ex
* @param {?boolean} rethrow If false, do not re-throw the exception.
* Only used for window.onerror to not cause an infinite loop of
* rethrowing.
* @param {...*} extraArgs Any arguments to pass to the registered handlers.
*/
function report(ex, rethrow) {
function report(ex, extraArgs) {
var args = _slice.call(arguments, 1);
if (lastExceptionStack) {
if (lastException === ex) {
Expand All @@ -240,10 +238,6 @@ TraceKit.report = (function reportModuleWrapper() {
processLastException();
}
}, (stack.incomplete ? 2000 : 0));

if (rethrow !== false) {
throw ex; // re-throw to propagate to the top level (and cause window.onerror)
}
}

report.subscribe = subscribe;
Expand Down