1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 17:45:10 +01:00

Add functionality to avoid sending error messages to sentry

This commit is contained in:
Tim Daubenschütz 2015-12-02 14:31:42 +01:00
parent 638804837e
commit 123e2a4d13
2 changed files with 7 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,7 @@ 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) {