Skip to content
Merged
Changes from 1 commit
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 @@ -1423,8 +1423,9 @@ Raven.prototype = {
var testString = (type || '') + ': ' + (message || '');

if (
!!this._globalOptions.ignoreErrors.test &&
this._globalOptions.ignoreErrors.test(testString)
!!this._globalOptions.ignoreErrors.test && (
this._globalOptions.ignoreErrors.test(message) ||
this._globalOptions.ignoreErrors.test(testString))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also change it so that testString doesn't become :message if it's undefined? per #1075 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Addressed.

Copy link
Contributor

@kamilogorek kamilogorek Oct 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code will double-check the same string if type is not defined, but I think we can live with it.

Although an alternative would be something like this, which also do the job, but doesn't improve a readability really

if (!!this._globalOptions.ignoreErrors.test) {
  var testString = (type ? type + ': ' : '') + (message || '')
  if (this._globalOptions.ignoreErrors.test(message)) return
  if (testString !== message && this._globalOptions.ignoreErrors.test(testString)) return
}

I can live with the code we have now.

)
return;

Expand Down