Commit 52767345 authored by Arek Mytych's avatar Arek Mytych Committed by Tim Neutkens

Update to use @sentry/browser, remove raven-js (#5253)

parent e892898d
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
}, },
"dependencies": { "dependencies": {
"next": "latest", "next": "latest",
"raven-js": "^3.19.1", "@sentry/browser": "^4.0.4",
"react": "^16.0.0", "react": "^16.5.2",
"react-dom": "^16.0.0" "react-dom": "^16.5.2"
}, },
"license": "ISC" "license": "ISC"
} }
import App from 'next/app' import App from 'next/app'
import Raven from 'raven-js' import * as Sentry from '@sentry/browser'
const SENTRY_PUBLIC_DSN = '' const SENTRY_PUBLIC_DSN = ''
export default class MyApp extends App { export default class MyApp extends App {
constructor (...args) { constructor (...args) {
super(...args) super(...args)
Raven.config(SENTRY_PUBLIC_DSN).install() Sentry.init({dsn: SENTRY_PUBLIC_DSN})
} }
componentDidCatch (error, errorInfo) { componentDidCatch (error, errorInfo) {
Raven.captureException(error, { extra: errorInfo }) Sentry.configureScope(scope => {
Object.keys(errorInfo).forEach(key => {
scope.setExtra(key, errorInfo[key])
})
})
Sentry.captureException(error)
// This is needed to render errors correctly in development / production // This is needed to render errors correctly in development / production
super.componentDidCatch(error, errorInfo) super.componentDidCatch(error, errorInfo)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment