1
0
mirror of https://github.com/ascribe/onion.git synced 2025-01-03 10:25:08 +01:00

Merge pull request #44 from ascribe/AD-1453-add-functionality-to-avoid-sending-error-messages-to-sentry

Add functionality to avoid sending error messages to sentry
This commit is contained in:
Tim Daubenschütz 2015-12-07 10:25:52 +01:00
commit 3996abcb5d
2 changed files with 8 additions and 3 deletions

View File

@ -114,7 +114,12 @@ const constants = {
}, },
'twitter': { 'twitter': {
'sdkUrl': 'https://platform.twitter.com/widgets.js' 'sdkUrl': 'https://platform.twitter.com/widgets.js'
} },
'errorMessagesToIgnore': [
'Authentication credentials were not provided.',
'Informations d\'authentification non fournies.'
]
}; };
export default constants; export default constants;

View File

@ -13,8 +13,8 @@ import AppConstants from '../constants/application_constants';
* @param {boolean} ignoreSentry Defines whether or not the error should be submitted to Sentry * @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 * @param {string} comment Will also be submitted to Sentry, but will not be logged
*/ */
function logGlobal(error, ignoreSentry, comment) { function logGlobal(error, ignoreSentry = AppConstants.errorMessagesToIgnore.indexOf(error.message) > -1,
comment) {
console.error(error); console.error(error);
if(!ignoreSentry) { if(!ignoreSentry) {