Skip to content

Commit dd5a3bc

Browse files
lethkamilogorek
authored andcommitted
fix: Correctly increment trimHeadFrames in captureMessage (#1224)
1 parent 9ad02d8 commit dd5a3bc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/raven.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,15 @@ Raven.prototype = {
513513
// fingerprint on msg, not stack trace (legacy behavior, could be
514514
// revisited)
515515
fingerprint: msg,
516-
// since we know this is a synthetic trace, the top N-most frames
517-
// MUST be from Raven.js, so mark them as in_app later by setting
518-
// trimHeadFrames
519-
trimHeadFrames: (options.trimHeadFrames || 0) + 1
516+
trimHeadFrames: 0
520517
},
521518
options
522519
);
520+
// Since we know this is a synthetic trace, the top frame (this function call)
521+
// MUST be from Raven.js, so mark it for trimming
522+
// We add to the trim counter so that callers can choose to trim extra frames, such
523+
// as utility functions.
524+
options.trimHeadFrames += 1;
523525

524526
var frames = this._prepareFrames(stack, options);
525527
data.stacktrace = {

0 commit comments

Comments
 (0)