mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 17:33:14 +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'
|
||||
},
|
||||
'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': {
|
||||
'appId': '420813844732240',
|
||||
@ -112,11 +116,7 @@ const constants = {
|
||||
'twitter': {
|
||||
'sdkUrl': 'https://platform.twitter.com/widgets.js'
|
||||
},
|
||||
'cloudfrontDomain': 'd1qjsxua1o9x03.cloudfront.net',
|
||||
'errorMessagesToIgnore': [
|
||||
'Authentication credentials were not provided.',
|
||||
'Informations d\'authentification non fournies.'
|
||||
]
|
||||
'cloudfrontDomain': 'd1qjsxua1o9x03.cloudfront.net'
|
||||
};
|
||||
|
||||
export default constants;
|
||||
|
@ -1,5 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
import Raven from 'raven-js';
|
||||
|
||||
import AppConstants from '../constants/application_constants';
|
||||
@ -16,10 +14,7 @@ function logGlobal(error, comment, ignoreSentry) {
|
||||
console.error(error);
|
||||
|
||||
if (error.hasOwnProperty('json')) {
|
||||
comment = {
|
||||
...comment,
|
||||
json: error.json
|
||||
};
|
||||
comment.json = error.json;
|
||||
}
|
||||
|
||||
if (!ignoreSentry) {
|
||||
@ -28,10 +23,12 @@ function logGlobal(error, comment, ignoreSentry) {
|
||||
}
|
||||
|
||||
export function initLogging() {
|
||||
const { raven: { ignoreErrors, url: ravenUrl }, version } = AppConstants;
|
||||
|
||||
// Initialize Raven for logging on Sentry
|
||||
Raven.config(AppConstants.raven.url, {
|
||||
release: AppConstants.version,
|
||||
ignoreErrors: AppConstants.errorMessagesToIgnore
|
||||
Raven.config(ravenUrl, {
|
||||
ignoreErrors,
|
||||
release: version,
|
||||
}).install();
|
||||
|
||||
window.onerror = Raven.process;
|
||||
@ -49,9 +46,7 @@ export function getJsonErrorsAsArray(error) {
|
||||
|
||||
const errorArrays = Object
|
||||
.keys(errors)
|
||||
.map((errorKey) => {
|
||||
return errors[errorKey];
|
||||
});
|
||||
.map((errorKey) => errors[errorKey]);
|
||||
|
||||
// Collapse each errorKey's errors into a flat array
|
||||
return [].concat(...errorArrays);
|
||||
|
Loading…
Reference in New Issue
Block a user