use try/catch

Signed-off-by: Jakob <jakob.roehrl@web.de>
This commit is contained in:
Jakob
2019-10-09 12:45:33 +02:00
parent 71e7c98fd6
commit 1c2c700593
3 changed files with 18 additions and 28 deletions

View File

@@ -131,19 +131,18 @@ export default {
})
actions.push({
action: async () => {
action: async() => {
this.hideMenu()
this.loading = true
try {
const newBoard = await this.$store.dispatch('cloneBoard', this.board)
this.loading = false
const route = this.routeTo
route.params.id = newBoard.id
this.$router.push(route)
}
catch {
} catch (e) {
OC.Notification.showTemporary(t('deck', 'An error occurred'))
console.error(e)
}
},
icon: 'icon-clone',