Skip to content

Commit

Permalink
Don't process a falsey error message
Browse files Browse the repository at this point in the history
Trying to fix #76
  • Loading branch information
mattrobenolt committed Oct 22, 2013
1 parent 50a8c94 commit 03d8925
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/raven.js
Expand Up @@ -439,6 +439,13 @@ function extractContextFromFrame(frame) {
function processException(type, message, fileurl, lineno, frames, options) {
var stacktrace, label, i;

// Sometimes an exception is getting logged in Sentry as
// <no message value>
// This can only mean that the message was falsey since this value
// is hardcoded into Sentry itself.
// At this point, if the message is falsey, we bail since it's useless
if (!message) return;

// IE8 really doesn't have Array.prototype.indexOf
// Filter out a message that matches our ignore list
i = globalOptions.ignoreErrors.length;
Expand Down
7 changes: 7 additions & 0 deletions test/raven.test.js
Expand Up @@ -451,6 +451,13 @@ describe('globals', function() {
extra: 'awesome'
}]);
});

it('should ignored falsey messages', function() {
this.sinon.stub(window, 'send');

processException('Error', '', 'http://example.com', []);
assert.isFalse(window.send.called);
});
});

describe('send', function() {
Expand Down

0 comments on commit 03d8925

Please sign in to comment.