File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -1141,8 +1141,6 @@ Raven.prototype = {
11411141 for ( var j = 0 ; j < options . trimHeadFrames && j < frames . length ; j ++ ) {
11421142 frames [ j ] . in_app = false ;
11431143 }
1144- // ... delete to prevent from appearing in outbound payload
1145- delete options . trimHeadFrames ;
11461144 }
11471145 }
11481146 frames = frames . slice ( 0 , this . _globalOptions . stackTraceLimit ) ;
@@ -1263,6 +1261,9 @@ Raven.prototype = {
12631261 baseData . request = httpData ;
12641262 }
12651263
1264+ // HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
1265+ if ( data . trimHeadFrames ) delete data . trimHeadFrames ;
1266+
12661267 data = objectMerge ( baseData , data ) ;
12671268
12681269 // Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
Original file line number Diff line number Diff line change @@ -79,6 +79,25 @@ describe('integration', function () {
7979 ) ;
8080 } ) ;
8181
82+ it ( 'should generate a synthetic trace for captureException w/ non-errors' , function ( done ) {
83+ var iframe = this . iframe ;
84+ iframeExecute ( iframe , done ,
85+ function ( ) {
86+ setTimeout ( done ) ;
87+
88+
89+ Raven . captureException ( { foo :'bar' } ) ;
90+ } ,
91+ function ( ) {
92+ var ravenData = iframe . contentWindow . ravenData [ 0 ] ;
93+ assert . isAbove ( ravenData . stacktrace . frames . length , 1 ) ;
94+
95+ // verify trimHeadFrames hasn't slipped into final payload
96+ assert . isUndefined ( ravenData . trimHeadFrames ) ;
97+ }
98+ ) ;
99+ } ) ;
100+
82101 it ( 'should capture an Error object passed to Raven.captureException w/ maxMessageLength set (#647)' , function ( done ) {
83102 var iframe = this . iframe ;
84103 iframeExecute ( iframe , done ,
You can’t perform that action at this time.
0 commit comments