Created
January 10, 2014 19:10
-
-
Save brianr/8360549 to your computer and use it in GitHub Desktop.
rollbar.js - ignore errors that aren't from a given domain (using rollbar.js version 0.10.8)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_rollbarConfig = { | |
"server.environment": "production", | |
// any other existing config... | |
checkIgnore: function(errMsg, file, line, col, err) { | |
// this function is called for all uncaught errors | |
// if it returns true, the error will be ignored | |
// instead of being reported to Rollbar. | |
if (file && !file.match(/^https?:\/\/www\.mycompany\.com/)) { | |
// has a filename, but filename (url) is not on www.mycompany.com. | |
// ignore. | |
return true; | |
} | |
// don't ignore anything else | |
return false; | |
} | |
} |
Since this gist seems to get all the google juice, the new way to do this is illustrated here: https://gist.github.com/coryvirok/2bd77c35db1ab758afe5
Here's the most updated way to do this: https://gist.github.com/and-megan/d234875541e88f4a8185adecb4b79734
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorry, thats doesn't work with last version:
I get this error:
col
anderr
areundefined
How i can solve this problem?
Thanks.