1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 09:23:13 +01:00

Use Raven's ignoreErrors configuration option to ignore certain errors

This commit is contained in:
Brett Sun 2016-01-08 14:49:39 +01:00
parent 2acf3f4056
commit 2cedfd636e

View File

@ -13,22 +13,19 @@ import AppConstants from '../constants/application_constants';
* @param {boolean} ignoreSentry Defines whether or not the error should be submitted to Sentry
* @param {string} comment Will also be submitted to Sentry, but will not be logged
*/
function logGlobal(error, comment, ignoreSentry = AppConstants.errorMessagesToIgnore.indexOf(error.message) > -1) {
function logGlobal(error, comment, ignoreSentry) {
console.error(error);
if (!ignoreSentry) {
if(comment) {
Raven.captureException(error, {extra: { comment }});
} else {
Raven.captureException(error);
}
Raven.captureException(error, comment ? { extra: { comment } } : undefined);
}
}
export function initLogging() {
// Initialize Raven for logging on Sentry
Raven.config(AppConstants.raven.url, {
release: AppConstants.version
release: AppConstants.version,
ignoreErrors: AppConstants.errorMessagesToIgnore
}).install();
window.onerror = Raven.process;