Skip to content

Commit 6b188f7

Browse files
committed
drop raven (#4990)
we're not using it anyhow
1 parent 2064285 commit 6b188f7

File tree

6 files changed

+4
-93
lines changed

6 files changed

+4
-93
lines changed

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@
103103
"postscribe": "2.0.8",
104104
"prop-types": "15.6.1",
105105
"rangy": "1.3.0",
106-
"raven-js": "3.22.3",
107106
"react": "16.9.0",
108107
"react-autocomplete": "1.8.1",
109108
"react-bootstrap": "0.32.1",

scripts/core/error/error.ts

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,9 @@
1-
import Raven from 'raven-js';
2-
import {appConfig} from 'appConfig';
3-
4-
ErrorHttpInterceptorFactory.$inject = ['$q'];
5-
function ErrorHttpInterceptorFactory($q) {
6-
return {
7-
responseError: function responseError(rejection) {
8-
if (rejection.status >= 500 && rejection.status < 600) {
9-
Raven.captureException(new Error('HTTP response error'), {
10-
tags: {component: 'server'},
11-
extra: {
12-
status: rejection.status,
13-
request: rejection.config,
14-
response: rejection.data,
15-
},
16-
});
17-
}
18-
return $q.reject(rejection);
19-
},
20-
};
21-
}
22-
231
/**
242
* @ngdoc module
253
* @module superdesk.core.error
264
* @name superdesk.core.error
275
* @packageName superdesk.core
286
* @description Superdesk error reporting module.
7+
* @deprecated
298
*/
30-
angular.module('superdesk.core.error', [])
31-
.config(['$httpProvider', '$provide', function($httpProvider, $provide) {
32-
if (appConfig.raven != null && appConfig.raven.dsn) {
33-
Raven.config(appConfig.raven.dsn, {
34-
logger: 'javascript-client',
35-
release: appConfig.version,
36-
}).install();
37-
38-
$httpProvider.interceptors.push(ErrorHttpInterceptorFactory);
39-
40-
$provide.factory('$exceptionHandler', () => function errorCatcherHandler(exception, cause) {
41-
Raven.captureException(exception, {tags: {component: 'ui'}, extra: exception});
42-
});
43-
}
44-
}]);
9+
angular.module('superdesk.core.error', []);

scripts/core/services/logger.ts

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,16 @@
1-
import Raven, {RavenOptions} from 'raven-js';
2-
31
class Logger {
4-
constructor() {
5-
/* globals __SUPERDESK_CONFIG__: true */
6-
const appConfig = __SUPERDESK_CONFIG__;
7-
8-
if (appConfig.raven && appConfig.raven.dsn.length > 0) {
9-
Raven.config(appConfig.raven.dsn, {
10-
logger: 'javascript-client',
11-
release: appConfig.version,
12-
}).install();
13-
}
14-
}
15-
162
error(
173
e: Error,
184
additionalData?: any, // has to be serializable to JSON string
195
) {
20-
console.error(e);
21-
22-
const options: RavenOptions = {};
23-
24-
if (additionalData != null) {
25-
try {
26-
options.extra = {additionalData: JSON.stringify(additionalData)};
27-
} catch (e) {
28-
options.extra = {additionalData: 'Failed to serialize'};
29-
}
30-
}
31-
32-
Raven.captureException(e, options);
6+
console.error(e, additionalData || '');
337
}
348

359
warn(
3610
message: string,
3711
additionalData?, // has to be serializable to JSON string
3812
) {
39-
const options: RavenOptions = {};
40-
41-
options['level'] = 'warning';
42-
43-
if (additionalData != null) {
44-
try {
45-
options.extra = {additionalData: JSON.stringify(additionalData)};
46-
} catch (e) {
47-
options.extra = {additionalData: 'Failed to serialize'};
48-
}
49-
}
50-
51-
console.warn(message, options);
52-
53-
if (Raven.isSetup()) {
54-
Raven.captureMessage(message, options);
55-
}
13+
console.warn(message, additionalData || '');
5614
}
5715
}
5816

scripts/vendor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import 'angular-contenteditable';
1515
import 'angular-vs-repeat';
1616
import 'angular-moment';
1717
import 'ng-file-upload';
18-
import 'raven-js';
1918
import 'rangy';
2019
import 'rangy-saverestore';
2120
import 'ment.io';

webpack.config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,11 +318,6 @@ function getDefaults(grunt) {
318318
// application version
319319
version: version || grunt.file.readJSON(path.join(__dirname, 'package.json')).version,
320320

321-
// raven settings
322-
raven: {
323-
dsn: process.env.SUPERDESK_RAVEN_DSN || '',
324-
},
325-
326321
// backend server URLs configuration
327322
server: {
328323
url: grunt.option('server') || process.env.SUPERDESK_URL || 'http://localhost:5000/api',

0 commit comments

Comments
 (0)