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:
parent
638804837e
commit
123e2a4d13
@ -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;
|
||||||
|
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user