Skip to content

Commit a264d8d

Browse files
authored
Add explain comment for synthetic trace path (#905)
1 parent 8d0bc42 commit a264d8d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/raven.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,10 @@ Raven.prototype = {
392392

393393
if (this._globalOptions.stacktrace || (options && options.stacktrace)) {
394394
var ex;
395-
// create a stack trace from this point; just trim
396-
// off extra frames so they don't include this function call (or
397-
// earlier Raven.js library fn calls)
395+
// Generate a "synthetic" stack trace from this point.
396+
// NOTE: If you are a Sentry user, and you are seeing this stack frame, it is NOT indicative
397+
// of a bug with Raven.js. Sentry generates synthetic traces either by configuration,
398+
// or if it catches a thrown object without a "stack" property.
398399
try {
399400
throw new Error(msg);
400401
} catch (ex1) {
@@ -408,6 +409,9 @@ Raven.prototype = {
408409
// fingerprint on msg, not stack trace (legacy behavior, could be
409410
// revisited)
410411
fingerprint: msg,
412+
// since we know this is a synthetic trace, the top N-most frames
413+
// MUST be from Raven.js, so mark them as in_app later by setting
414+
// trimHeadFrames
411415
trimHeadFrames: (options.trimHeadFrames || 0) + 1
412416
}, options);
413417

0 commit comments

Comments
 (0)