Skip to content

Commit 50beaa5

Browse files
lethkamilogorek
authored andcommitted
fix: Use correct trimHeadFrames value if capturing new trace
1 parent 4180abe commit 50beaa5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/raven.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,7 @@ Raven.prototype = {
408408
* @return {Raven}
409409
*/
410410
captureException: function(ex, options) {
411+
options = objectMerge({trimHeadFrames: 0}, options ? options : {});
411412
// Cases for sending ex as a message, rather than an exception
412413
var isNotError = !isError(ex);
413414
var isNotErrorEvent = !isErrorEvent(ex);
@@ -416,13 +417,10 @@ Raven.prototype = {
416417
if ((isNotError && isNotErrorEvent) || isErrorEventWithoutError) {
417418
return this.captureMessage(
418419
ex,
419-
objectMerge(
420-
{
421-
trimHeadFrames: 1,
422-
stacktrace: true // if we fall back to captureMessage, default to attempting a new trace
423-
},
424-
options
425-
)
420+
objectMerge(options, {
421+
stacktrace: true, // if we fall back to captureMessage, default to attempting a new trace
422+
trimHeadFrames: options.trimHeadFrames + 1
423+
})
426424
);
427425
}
428426

0 commit comments

Comments
 (0)