feat: throw errors (#867)
Co-authored-by: Dominik Pschenitschni <mail@celement.de> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/867 Co-authored-by: dpschen <dpschen@noreply.kolaente.de> Co-committed-by: dpschen <dpschen@noreply.kolaente.de>
This commit is contained in:
parent
bc7b577748
commit
a70b92253a
1 changed files with 14 additions and 13 deletions
27
src/main.ts
27
src/main.ts
|
@ -106,21 +106,22 @@ if (import.meta.env.DEV) {
|
|||
app.config.warnHandler = (msg, vm, info) => {
|
||||
error(msg)
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/a/52076738/15522256
|
||||
window.addEventListener('error', (err) => {
|
||||
error(err)
|
||||
throw err
|
||||
})
|
||||
|
||||
|
||||
window.addEventListener('unhandledrejection', (err) => {
|
||||
// event.promise contains the promise object
|
||||
// event.reason contains the reason for the rejection
|
||||
error(err)
|
||||
throw err
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// https://stackoverflow.com/a/52076738/15522256
|
||||
window.addEventListener('error', (err) => {
|
||||
error(err)
|
||||
})
|
||||
|
||||
|
||||
window.addEventListener('unhandledrejection', (err) => {
|
||||
// event.promise contains the promise object
|
||||
// event.reason contains the reason for the rejection
|
||||
error(err)
|
||||
})
|
||||
|
||||
app.config.globalProperties.$message = {
|
||||
error,
|
||||
success,
|
||||
|
|
Loading…
Reference in a new issue