#【Sentry】Vue.js まとめ
1. Setup
entry.js
Sentry.init({
dsn: process.env.SENTRY_DSN,
integrations: [new Integrations.Vue({ Vue, attachProps: true })]
})
2. Set user info
auth.js
const user = data.user
Sentry.configureScope(scope => {
scope.setUser({
id: user.staff_id,
username: user.account,
email: user.email_account
})
})
3. Catch api error
action.js
try {
dispatch('get api')
} catch (error) {
Sentry.captureException(error)
}