1
0

feat: don't rethrow same error and handle errors globally

This commit is contained in:
Dominik Pschenitschni
2021-10-09 16:04:19 +02:00
parent 6f51921588
commit 3b940cb56c
71 changed files with 69 additions and 451 deletions

View File

@ -211,9 +211,6 @@ export default {
this.tasks = tasks
})
.catch(e => {
this.$message.error(e)
})
},
updateTasks(updatedTask) {
for (const t in this.tasks) {

View File

@ -574,9 +574,6 @@ export default {
this.setActiveFields()
this.setTitle(this.task.title)
})
.catch(e => {
this.$message.error(e)
})
.finally(() => {
this.$nextTick(() => this.visible = true)
this.scrollToHeading()
@ -620,25 +617,21 @@ export default {
this.task.endDate = this.task.dueDate
}
try {
this.task = await this.$store.dispatch('tasks/update', this.task)
this.setActiveFields()
this.task = await this.$store.dispatch('tasks/update', this.task)
this.setActiveFields()
if (!showNotification) {
return
}
let actions = []
if (undoCallback !== null) {
actions = [{
title: 'Undo',
callback: undoCallback,
}]
}
this.$message.success({message: this.$t('task.detail.updateSuccess')}, actions)
} catch(e) {
this.$message.error(e)
if (!showNotification) {
return
}
let actions = []
if (undoCallback !== null) {
actions = [{
title: 'Undo',
callback: undoCallback,
}]
}
this.$message.success({message: this.$t('task.detail.updateSuccess')}, actions)
},
setFieldActive(fieldName) {
this.activeFields[fieldName] = true
@ -664,9 +657,6 @@ export default {
this.$message.success({message: this.$t('task.detail.deleteSuccess')})
this.$router.push({name: 'list.index', params: {listId: this.task.listId}})
})
.catch(e => {
this.$message.error(e)
})
},
toggleTaskDone() {
this.task.done = !this.task.done
@ -705,9 +695,6 @@ export default {
this.task = t
this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist')
})
.catch(e => {
this.$message.error(e)
})
},
},
}