mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -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;
|
const executionId = this.$route.params.id;
|
||||||
await this.openExecution(executionId);
|
await this.openExecution(executionId);
|
||||||
} else {
|
} else {
|
||||||
const result = this.uiStore.stateIsDirty;;
|
const result = this.uiStore.stateIsDirty;
|
||||||
if (result) {
|
if (result) {
|
||||||
const confirmModal = await this.confirmModal(
|
const confirmModal = await this.confirmModal(
|
||||||
this.$locale.baseText('generic.unsavedWork.confirmMessage.message'),
|
this.$locale.baseText('generic.unsavedWork.confirmMessage.message'),
|
||||||
|
@ -2210,17 +2210,18 @@ export default mixins(
|
||||||
workflowId = this.$route.params.name;
|
workflowId = this.$route.params.name;
|
||||||
}
|
}
|
||||||
if (workflowId !== null) {
|
if (workflowId !== null) {
|
||||||
const workflow = await this.restApi().getWorkflow(workflowId);
|
let workflow;
|
||||||
if (!workflow) {
|
try {
|
||||||
|
workflow = await this.restApi().getWorkflow(workflowId);
|
||||||
|
} catch (error) {
|
||||||
|
this.$showError(error, this.$locale.baseText('openWorkflow.workflowNotFoundError'));
|
||||||
|
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: VIEWS.NEW_WORKFLOW,
|
name: VIEWS.NEW_WORKFLOW,
|
||||||
});
|
});
|
||||||
this.$showMessage({
|
}
|
||||||
title: 'Error',
|
|
||||||
message: this.$locale.baseText('openWorkflow.workflowNotFoundError'),
|
if (workflow) {
|
||||||
type: 'error',
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$titleSet(workflow.name, 'IDLE');
|
this.$titleSet(workflow.name, 'IDLE');
|
||||||
// Open existing workflow
|
// Open existing workflow
|
||||||
await this.openWorkflow(workflowId);
|
await this.openWorkflow(workflowId);
|
||||||
|
|
Loading…
Reference in a new issue