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:
dpschen 2021-10-17 21:32:21 +00:00 committed by konrad
parent bc7b577748
commit a70b92253a

View file

@ -106,20 +106,21 @@ if (import.meta.env.DEV) {
app.config.warnHandler = (msg, vm, info) => { app.config.warnHandler = (msg, vm, info) => {
error(msg) error(msg)
} }
}
// https://stackoverflow.com/a/52076738/15522256
// https://stackoverflow.com/a/52076738/15522256 window.addEventListener('error', (err) => {
window.addEventListener('error', (err) => {
error(err) error(err)
}) throw err
})
window.addEventListener('unhandledrejection', (err) => { window.addEventListener('unhandledrejection', (err) => {
// event.promise contains the promise object // event.promise contains the promise object
// event.reason contains the reason for the rejection // event.reason contains the reason for the rejection
error(err) error(err)
}) throw err
})
}
app.config.globalProperties.$message = { app.config.globalProperties.$message = {
error, error,