diff --git a/src/stores/tasks.ts b/src/stores/tasks.ts index b192e0a2..958b7578 100644 --- a/src/stores/tasks.ts +++ b/src/stores/tasks.ts @@ -377,12 +377,17 @@ export const useTaskStore = defineStore('task', { task.repeatAfter = parsedTask.repeats const taskService = new TaskService() - const createdTask = await taskService.create(task) - const result = await this.addLabelsToTask({ - task: createdTask, - parsedLabels: parsedTask.labels, - }) - cancel() + try { + const createdTask = await taskService.create(task) + const result = await this.addLabelsToTask({ + task: createdTask, + parsedLabels: parsedTask.labels, + }) + } catch (e) { + throw e + } finally { + cancel() + } return result }, },