Skip to content

Commit 7b54c9c

Browse files
committed
Migrate raven to sentry in frontend
1 parent 31ac778 commit 7b54c9c

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

frontend/javascript/app.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
// Install Raven to send errors to Sentry
2-
import Raven from 'raven-js';
3-
Raven
4-
.config('https://151ecfab1a8242009012d45a19064cfd@sentry.io/133175')
5-
.install();
1+
// Install Sentry to send errors to Sentry
2+
import * as Sentry from '@sentry/browser';
3+
Sentry.init(
4+
{
5+
dsn: 'https://151ecfab1a8242009012d45a19064cfd@sentry.io/133175'
6+
}
7+
);
68

79
// Capture unhandled exceptions in promises
810
window.addEventListener('unhandledrejection', err => {
9-
Raven.captureException(err.reason);
11+
Sentry.captureException(err.reason);
1012
});
1113

1214
// Load the rest of the modules

frontend/javascript/modules/errorReport.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Raven from 'raven-js';
1+
import * as Sentry from '@sentry/browser';
22

33
export default class ErrorReport {
44
constructor(btn) {
@@ -8,11 +8,11 @@ export default class ErrorReport {
88
}
99

1010
render() {
11-
this.btn.addEventListener('click', () => this._invokeRavenModal());
11+
this.btn.addEventListener('click', () => this._invokeSentryModal());
1212
}
1313

14-
_invokeRavenModal() {
15-
Raven.showReportDialog({
14+
_invokeSentryModal() {
15+
Sentry.showReportDialog({
1616
eventId: this.eventId
1717
});
1818
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"demo": "gulp production"
2626
},
2727
"dependencies": {
28+
"@sentry/browser": "^5.29.2",
2829
"bootstrap": "^3.3.6",
2930
"bootstrap-material-datetimepicker": "https://github.com/T00rk/bootstrap-material-datetimepicker.git#gh-pages",
3031
"bootstrap-sass": "^3.4.1",
@@ -89,7 +90,6 @@
8990
"object-assign": "4.1.0",
9091
"open": "0.0.5",
9192
"pretty-hrtime": "1.0.2",
92-
"raven-js": "^3.27.2",
9393
"require-dir": "1.2.0",
9494
"sinon": "1.17.4",
9595
"sinon-chai": "2.8.0",

0 commit comments

Comments
 (0)