Skip to content

Commit 354c7cd

Browse files
evgeniuskamilogorek
authored andcommitted
fix: Remove a redundant try-catch block (#445)
1 parent 565d780 commit 354c7cd

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/client.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,18 +337,12 @@ extend(Raven.prototype, {
337337
var eventId = this.generateEventId();
338338

339339
if (this.stacktrace) {
340-
var ex;
341-
// Generate a "synthetic" stack trace
342-
try {
343-
throw new Error(message);
344-
} catch (ex1) {
345-
ex = ex1;
346-
}
340+
var ex = new Error(message);
347341

348342
utils.parseStack(
349343
ex,
350344
function(frames) {
351-
// We trim last frame, as it's our `throw new Error(message)` call itself, which is redundant
345+
// We trim last frame, as it's our `new Error(message)` statement itself, which is redundant
352346
kwargs.stacktrace = {
353347
frames: frames.slice(0, -1)
354348
};

0 commit comments

Comments
 (0)