Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -1141,8 +1141,6 @@ Raven.prototype = {
for (var j = 0; j < options.trimHeadFrames && j < frames.length; j++) {
frames[j].in_app = false;
}
// ... delete to prevent from appearing in outbound payload
delete options.trimHeadFrames;
}
}
frames = frames.slice(0, this._globalOptions.stackTraceLimit);
Expand Down Expand Up @@ -1263,6 +1261,9 @@ Raven.prototype = {
baseData.request = httpData;
}

// HACK: delete `trimHeadFrames` to prevent from appearing in outbound payload
if (data.trimHeadFrames) delete data.trimHeadFrames;

data = objectMerge(baseData, data);

// Merge in the tags and extra separately since objectMerge doesn't handle a deep merge
Expand Down
19 changes: 19 additions & 0 deletions test/integration/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@ describe('integration', function () {
);
});

it('should generate a synthetic trace for captureException w/ non-errors', function (done) {
var iframe = this.iframe;
iframeExecute(iframe, done,
function () {
setTimeout(done);


Raven.captureException({foo:'bar'});
},
function () {
var ravenData = iframe.contentWindow.ravenData[0];
assert.isAbove(ravenData.stacktrace.frames.length, 1);

// verify trimHeadFrames hasn't slipped into final payload
assert.isUndefined(ravenData.trimHeadFrames);
}
);
});

it('should capture an Error object passed to Raven.captureException w/ maxMessageLength set (#647)', function (done) {
var iframe = this.iframe;
iframeExecute(iframe, done,
Expand Down