Skip to content

Commit 40dd577

Browse files
committed
captureMessage() uses global ignoreErrors config
Previously, only errors recorded using captureException were checked against the ignoreErrors regexp. captureMessage will now silently discard messages which match ignoreErrors.
1 parent 43dd05d commit 40dd577

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/raven.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,13 @@ var Raven = {
261261
* @return {Raven}
262262
*/
263263
captureMessage: function(msg, options) {
264+
// config() automagically converts ignoreErrors from a list to a RegExp so we need to test for an
265+
// early call; we'll error on the side of logging anything called before configuration since it's
266+
// probably something you should see:
267+
if (!!globalOptions.ignoreErrors.test && globalOptions.ignoreErrors.test(msg)) {
268+
return;
269+
}
270+
264271
// Fire away!
265272
send(
266273
objectMerge({

0 commit comments

Comments
 (0)