diff --git a/js/constants/application_constants.js b/js/constants/application_constants.js index a58a8cc6..67b8614d 100644 --- a/js/constants/application_constants.js +++ b/js/constants/application_constants.js @@ -114,7 +114,12 @@ const constants = { }, 'twitter': { 'sdkUrl': 'https://platform.twitter.com/widgets.js' - } + }, + + 'errorMessagesToIgnore': [ + 'Authentication credentials were not provided.', + 'Informations d\'authentification non fournies.' + ] }; export default constants; diff --git a/js/utils/error_utils.js b/js/utils/error_utils.js index 4e9de6e2..753bbf61 100644 --- a/js/utils/error_utils.js +++ b/js/utils/error_utils.js @@ -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 {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); if(!ignoreSentry) {