Skip to content

Instantly share code, notes, and snippets.

@brianr
Created January 10, 2014 19:10
Show Gist options
  • Save brianr/8360549 to your computer and use it in GitHub Desktop.
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)
_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;
}
}
@and-megan
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment