Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: Remove a redundant try-catch block (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenius authored and kamilogorek committed Apr 5, 2018
1 parent 565d780 commit 354c7cd
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,12 @@ extend(Raven.prototype, {
var eventId = this.generateEventId();

if (this.stacktrace) {
var ex;
// Generate a "synthetic" stack trace
try {
throw new Error(message);
} catch (ex1) {
ex = ex1;
}
var ex = new Error(message);

utils.parseStack(
ex,
function(frames) {
// We trim last frame, as it's our `throw new Error(message)` call itself, which is redundant
// We trim last frame, as it's our `new Error(message)` statement itself, which is redundant
kwargs.stacktrace = {
frames: frames.slice(0, -1)
};
Expand Down

0 comments on commit 354c7cd

Please sign in to comment.