From d62c7a7f3cda127e4a0e5dc4bbd2516ecce86812 Mon Sep 17 00:00:00 2001 From: Anuj Kapoor Date: Fri, 3 Dec 2021 20:07:04 +0530 Subject: [PATCH] :bug: Add error pop up and redirection for non existing workflow IDs (#2516) * :bug: Add error pop up and redirection for non existing workflow IDs * Remove code comments --- packages/editor-ui/src/views/NodeView.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index de33d7e3bc..6a131c4e06 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -1633,11 +1633,19 @@ export default mixins( if (workflowId !== null) { const workflow = await this.restApi().getWorkflow(workflowId); if (!workflow) { - throw new Error('Could not find workflow'); + this.$router.push({ + name: "NodeViewNew", + }); + this.$showMessage({ + title: 'Error', + message: 'Could not find workflow', + type: 'error', + }); + } else { + this.$titleSet(workflow.name, 'IDLE'); + // Open existing workflow + await this.openWorkflow(workflowId); } - this.$titleSet(workflow.name, 'IDLE'); - // Open existing workflow - await this.openWorkflow(workflowId); } else { // Create new workflow await this.newWorkflow();