提交 52767345 编写于 作者: A Arek Mytych 提交者: Tim Neutkens

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

上级 e892898d
......@@ -8,9 +8,9 @@
},
"dependencies": {
"next": "latest",
"raven-js": "^3.19.1",
"react": "^16.0.0",
"react-dom": "^16.0.0"
"@sentry/browser": "^4.0.4",
"react": "^16.5.2",
"react-dom": "^16.5.2"
},
"license": "ISC"
}
import App from 'next/app'
import Raven from 'raven-js'
import * as Sentry from '@sentry/browser'
const SENTRY_PUBLIC_DSN = ''
export default class MyApp extends App {
constructor (...args) {
super(...args)
Raven.config(SENTRY_PUBLIC_DSN).install()
Sentry.init({dsn: SENTRY_PUBLIC_DSN})
}
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
super.componentDidCatch(error, errorInfo)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册