mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
fix: Handle error when workflow does not exist or is inaccessible (#4831)
This commit is contained in:
parent
4528f34462
commit
b71295e4de
|
@ -2187,7 +2187,7 @@ export default mixins(
|
|||
const executionId = this.$route.params.id;
|
||||
await this.openExecution(executionId);
|
||||
} else {
|
||||
const result = this.uiStore.stateIsDirty;;
|
||||
const result = this.uiStore.stateIsDirty;
|
||||
if (result) {
|
||||
const confirmModal = await this.confirmModal(
|
||||
this.$locale.baseText('generic.unsavedWork.confirmMessage.message'),
|
||||
|
@ -2210,17 +2210,18 @@ export default mixins(
|
|||
workflowId = this.$route.params.name;
|
||||
}
|
||||
if (workflowId !== null) {
|
||||
const workflow = await this.restApi().getWorkflow(workflowId);
|
||||
if (!workflow) {
|
||||
let workflow;
|
||||
try {
|
||||
workflow = await this.restApi().getWorkflow(workflowId);
|
||||
} catch (error) {
|
||||
this.$showError(error, this.$locale.baseText('openWorkflow.workflowNotFoundError'));
|
||||
|
||||
this.$router.push({
|
||||
name: VIEWS.NEW_WORKFLOW,
|
||||
});
|
||||
this.$showMessage({
|
||||
title: 'Error',
|
||||
message: this.$locale.baseText('openWorkflow.workflowNotFoundError'),
|
||||
type: 'error',
|
||||
});
|
||||
} else {
|
||||
}
|
||||
|
||||
if (workflow) {
|
||||
this.$titleSet(workflow.name, 'IDLE');
|
||||
// Open existing workflow
|
||||
await this.openWorkflow(workflowId);
|
||||
|
|
Loading…
Reference in a new issue