fix(sentry): do not send api errors to sentry
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
f34577f293
commit
117079bbda
@ -1,6 +1,7 @@
|
||||
import 'virtual:vite-plugin-sentry/sentry-config'
|
||||
import type {App} from 'vue'
|
||||
import type {Router} from 'vue-router'
|
||||
import {AxiosError} from 'axios'
|
||||
|
||||
export default async function setupSentry(app: App, router: Router) {
|
||||
const Sentry = await import('@sentry/vue')
|
||||
@ -18,5 +19,15 @@ export default async function setupSentry(app: App, router: Router) {
|
||||
}),
|
||||
],
|
||||
tracesSampleRate: 1.0,
|
||||
beforeSend(event, hint) {
|
||||
|
||||
if ((typeof hint.originalException?.code !== 'undefined' &&
|
||||
typeof hint.originalException?.message !== 'undefined')
|
||||
|| hint.originalException instanceof AxiosError) {
|
||||
return null
|
||||
}
|
||||
|
||||
return event
|
||||
},
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user