Skip to content

Instantly share code, notes, and snippets.

@sarkistlt
Created June 15, 2017 19:12
Show Gist options
  • Save sarkistlt/d874d0bfe23e339d979a6898d2e5e0af to your computer and use it in GitHub Desktop.
Save sarkistlt/d874d0bfe23e339d979a6898d2e5e0af to your computer and use it in GitHub Desktop.
function ignoreThisMessage(isUncaught, args, payload) {
var ignore = "Protocols, domains, and ports must match.";
if (
payload &&
payload.body &&
payload.body.message &&
payload.body.message.body &&
!!~payload.body.message.body.indexOf(ignore)
) {
return true
};
}
if (Rollbar) Rollbar.configure({checkIgnore: ignoreThisMessage});
@jasonsyoung
Copy link

This will fail if Rollbar doesn't load. You can't check existence of a variable that was never set.

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