fix(sentry): do not send api errors to sentry
continuous-integration/drone/push Build is failing Details

This commit is contained in:
kolaente 2024-03-13 19:31:43 +01:00
parent f34577f293
commit 117079bbda
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 11 additions and 0 deletions

View File

@ -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
},
})
}