mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 18:35:09 +01:00
Consolidate Raven constants under one namespace
This commit is contained in:
parent
3291af0812
commit
dbaf1a2e99
@ -103,7 +103,11 @@ const constants = {
|
|||||||
'cssUrl': '//vjs.zencdn.net/4.12/video-js.css'
|
'cssUrl': '//vjs.zencdn.net/4.12/video-js.css'
|
||||||
},
|
},
|
||||||
'raven': {
|
'raven': {
|
||||||
'url': 'https://0955da3388c64ab29bd32c2a429f9ef4@app.getsentry.com/48351'
|
ignoreErrors: [
|
||||||
|
'Authentication credentials were not provided.',
|
||||||
|
'Informations d\'authentification non fournies.'
|
||||||
|
],
|
||||||
|
url: process.env.RAVEN_DSL_URL
|
||||||
},
|
},
|
||||||
'facebook': {
|
'facebook': {
|
||||||
'appId': '420813844732240',
|
'appId': '420813844732240',
|
||||||
@ -112,11 +116,7 @@ const constants = {
|
|||||||
'twitter': {
|
'twitter': {
|
||||||
'sdkUrl': 'https://platform.twitter.com/widgets.js'
|
'sdkUrl': 'https://platform.twitter.com/widgets.js'
|
||||||
},
|
},
|
||||||
'cloudfrontDomain': 'd1qjsxua1o9x03.cloudfront.net',
|
'cloudfrontDomain': 'd1qjsxua1o9x03.cloudfront.net'
|
||||||
'errorMessagesToIgnore': [
|
|
||||||
'Authentication credentials were not provided.',
|
|
||||||
'Informations d\'authentification non fournies.'
|
|
||||||
]
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default constants;
|
export default constants;
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
'use strict';
|
|
||||||
|
|
||||||
import Raven from 'raven-js';
|
import Raven from 'raven-js';
|
||||||
|
|
||||||
import AppConstants from '../constants/application_constants';
|
import AppConstants from '../constants/application_constants';
|
||||||
@ -16,10 +14,7 @@ function logGlobal(error, comment, ignoreSentry) {
|
|||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
if (error.hasOwnProperty('json')) {
|
if (error.hasOwnProperty('json')) {
|
||||||
comment = {
|
comment.json = error.json;
|
||||||
...comment,
|
|
||||||
json: error.json
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ignoreSentry) {
|
if (!ignoreSentry) {
|
||||||
@ -28,10 +23,12 @@ function logGlobal(error, comment, ignoreSentry) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function initLogging() {
|
export function initLogging() {
|
||||||
|
const { raven: { ignoreErrors, url: ravenUrl }, version } = AppConstants;
|
||||||
|
|
||||||
// Initialize Raven for logging on Sentry
|
// Initialize Raven for logging on Sentry
|
||||||
Raven.config(AppConstants.raven.url, {
|
Raven.config(ravenUrl, {
|
||||||
release: AppConstants.version,
|
ignoreErrors,
|
||||||
ignoreErrors: AppConstants.errorMessagesToIgnore
|
release: version,
|
||||||
}).install();
|
}).install();
|
||||||
|
|
||||||
window.onerror = Raven.process;
|
window.onerror = Raven.process;
|
||||||
@ -49,9 +46,7 @@ export function getJsonErrorsAsArray(error) {
|
|||||||
|
|
||||||
const errorArrays = Object
|
const errorArrays = Object
|
||||||
.keys(errors)
|
.keys(errors)
|
||||||
.map((errorKey) => {
|
.map((errorKey) => errors[errorKey]);
|
||||||
return errors[errorKey];
|
|
||||||
});
|
|
||||||
|
|
||||||
// Collapse each errorKey's errors into a flat array
|
// Collapse each errorKey's errors into a flat array
|
||||||
return [].concat(...errorArrays);
|
return [].concat(...errorArrays);
|
||||||
|
Loading…
Reference in New Issue
Block a user