diff --git a/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue b/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue index 3e2653797d..98f8377a04 100644 --- a/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue +++ b/packages/editor-ui/src/components/ExecutionsView/ExecutionsList.vue @@ -54,7 +54,7 @@ import { Route } from 'vue-router'; import { executionHelpers } from '@/mixins/executionsHelpers'; import { range as _range } from 'lodash'; import { debounceHelper } from '@/mixins/debounce'; -import { getNodeViewTab } from '@/utils'; +import { getNodeViewTab, NO_NETWORK_ERROR_CODE } from '@/utils'; import { workflowHelpers } from '@/mixins/workflowHelpers'; import { mapStores } from 'pinia'; import { useWorkflowsStore } from '@/stores/workflows'; @@ -372,8 +372,9 @@ export default mixins( if (updatedActiveExecution !== null) { this.workflowsStore.activeWorkflowExecution = updatedActiveExecution; } else { - const activeNotInTheList = - existingExecutions.find((ex) => ex.id === this.activeExecution.id) === undefined; + const activeNotInTheList = !existingExecutions.some( + (ex) => ex.id === this.activeExecution?.id, + ); if (activeNotInTheList && this.executions.length > 0) { this.$router .push({ @@ -394,7 +395,22 @@ export default mixins( try { return await this.workflowsStore.loadCurrentWorkflowExecutions(this.filter); } catch (error) { - this.$showError(error, this.$locale.baseText('executionsList.showError.refreshData.title')); + if (error.errorCode === NO_NETWORK_ERROR_CODE) { + this.$showMessage( + { + title: this.$locale.baseText('executionsList.showError.refreshData.title'), + message: error.message, + type: 'error', + duration: 3500, + }, + false, + ); + } else { + this.$showError( + error, + this.$locale.baseText('executionsList.showError.refreshData.title'), + ); + } return []; } }, diff --git a/packages/editor-ui/src/utils/apiUtils.ts b/packages/editor-ui/src/utils/apiUtils.ts index 04b97dd78e..bd107ae78f 100644 --- a/packages/editor-ui/src/utils/apiUtils.ts +++ b/packages/editor-ui/src/utils/apiUtils.ts @@ -1,6 +1,8 @@ import axios, { AxiosRequestConfig, Method } from 'axios'; import { IDataObject } from 'n8n-workflow'; -import type { IRestApiContext } from '../Interface'; +import type { IRestApiContext } from '@/Interface'; + +export const NO_NETWORK_ERROR_CODE = 999; class ResponseError extends Error { // The HTTP status code of response @@ -67,7 +69,9 @@ async function request(config: { return response.data; } catch (error) { if (error.message === 'Network Error') { - throw new ResponseError('API-Server can not be reached. It is probably down.'); + throw new ResponseError('API-Server can not be reached. It is probably down.', { + errorCode: NO_NETWORK_ERROR_CODE, + }); } const errorResponseData = error.response.data;