1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Sentry】Vue.js Integration まとめ

Last updated at Posted at 2020-01-20

#【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)
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?