feature/vue3-global-error-management #833
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#833
Loading…
Reference in New Issue
No description provided.
Delete Branch "feature/vue3-global-error-management"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This pull request changes the way errors are handled. Basically I removed all the default error handlers and replaced them with one global as long as they didn't have a specific error message (then they stay). Not 100% convinced that is something that should stay.
Later I might need to readd some
catch
blocks. My idea was to create something like a "sentry suuper lite". So no backend or anything. But throw and show every error there is to be able to find out if it's important or not.I think that's important because it might be that there are still some errors in the application from the vue 3 transition that I'm not aware of because they get catched somewhere silently.
dpschen referenced this pull request2021-10-12 14:13:44 +00:00
c3ba3c58bc
tod4fed645b4
WIP: feature/vue3-global-error-managementto feature/vue3-global-error-managementd4fed645b4
to571c69311e
@ -99,2 +99,3 @@
console.error(err, vm, info)
// console.error(err, vm, info)
error(err)
// }
Can you remove the commented code? (not 100% sure if you've already done this somewhere else, in that case please ignore my comment)
@ -446,3 +419,3 @@
* @returns {Q.Promise<any>}
*/
delete(model) {
async delete(model) {
If the delete method is async, shouldn' the rest also be async?
Or are they already by nature of returning the call to the
http...
methods?As long as they always return a promise they are already async – which should be the case if they return the call of a async function like axios.
Most of the time you add async to a function if you use
await
directly.@ -105,3 +97,1 @@
})
.catch(e => Promise.reject(e))
.finally(() => cancel())
try {
Any special reason to use
try .. finally
overthen().finally()
? I think both are fine, just curious. I think we should decide on one style and stick with it.async
…await
withtry
…catch
is the way to go.There are some cases where I prefere
.then()
because I think the syntax is better:instead of
Because
async
/await
in the end is syntactic sugor over promises sometimes you really need to use promises instead. E.g. here you need to use promises because a constructor cannot be async.By the way: there was an issue:
reminderDates
was just filled in the async callback of the promise. But the promise was just necessary for the notifications – not for the creation of thereminderDates
.I see, thanks for clarifying. The article you linked to makes a lot of sense.
571c69311e
tob10e14546d
b10e14546d
to30d6b7e6fc
85967e7a9a
toa776e1d2f3
I'll close this in favor of #832.
Since I'm developing there already either way and the commmits are included I think that should be fine.