Previously, with the deprecated client Raven, you could easily ignore troublesome errors like this:
Raven.config('your-dsn', {
ignoreErrors: [
'Can\'t execute code from freed script',
/SecurityError\: DOM Exception 18$/
]
}).install();
Now, with the new client, the only way I discovered to achieve a similar effect is through the before-send
hook:
import * as Sentry from '@sentry/browser';
init({
beforeSend(event, hint) {
const { message } = hint.originalException;
if (message && message.match(/database unavailable/i)) {
return null;
}
return event;
}
});
Despite searching extensively through the documentation, I couldn't find a universal method to ignore errors.