mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix: Display readable error when manual executions contains large payload (#8834)
This commit is contained in:
parent
76fe960a76
commit
261b9c73d6
|
@ -1951,6 +1951,7 @@
|
||||||
"workflowPreview.showError.previewError.title": "Preview error",
|
"workflowPreview.showError.previewError.title": "Preview error",
|
||||||
"workflowRun.noActiveConnectionToTheServer": "Lost connection to the server",
|
"workflowRun.noActiveConnectionToTheServer": "Lost connection to the server",
|
||||||
"workflowRun.showError.title": "Problem running workflow",
|
"workflowRun.showError.title": "Problem running workflow",
|
||||||
|
"workflowRun.showError.payloadTooLarge": "Please execute the whole workflow, rather than just the node. (Existing execution data is too large.)",
|
||||||
"workflowRun.showMessage.message": "Please fix them before executing",
|
"workflowRun.showMessage.message": "Please fix them before executing",
|
||||||
"workflowRun.showMessage.title": "Workflow has issues",
|
"workflowRun.showMessage.title": "Workflow has issues",
|
||||||
"workflowSettings.callerIds": "IDs of workflows that can call this one",
|
"workflowSettings.callerIds": "IDs of workflows that can call this one",
|
||||||
|
|
|
@ -82,6 +82,8 @@ import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||||
import { useUsersStore } from '@/stores/users.store';
|
import { useUsersStore } from '@/stores/users.store';
|
||||||
import { useSettingsStore } from '@/stores/settings.store';
|
import { useSettingsStore } from '@/stores/settings.store';
|
||||||
import { getCredentialOnlyNodeTypeName } from '@/utils/credentialOnlyNodes';
|
import { getCredentialOnlyNodeTypeName } from '@/utils/credentialOnlyNodes';
|
||||||
|
import { ResponseError } from '@/utils/apiUtils';
|
||||||
|
import { i18n } from '@/plugins/i18n';
|
||||||
|
|
||||||
const defaults: Omit<IWorkflowDb, 'id'> & { settings: NonNullable<IWorkflowDb['settings']> } = {
|
const defaults: Omit<IWorkflowDb, 'id'> & { settings: NonNullable<IWorkflowDb['settings']> } = {
|
||||||
name: '',
|
name: '',
|
||||||
|
@ -1338,12 +1340,22 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||||
|
|
||||||
async runWorkflow(startRunData: IStartRunData): Promise<IExecutionPushResponse> {
|
async runWorkflow(startRunData: IStartRunData): Promise<IExecutionPushResponse> {
|
||||||
const rootStore = useRootStore();
|
const rootStore = useRootStore();
|
||||||
|
try {
|
||||||
return await makeRestApiRequest(
|
return await makeRestApiRequest(
|
||||||
rootStore.getRestApiContext,
|
rootStore.getRestApiContext,
|
||||||
'POST',
|
'POST',
|
||||||
'/workflows/run',
|
'/workflows/run',
|
||||||
startRunData as unknown as IDataObject,
|
startRunData as unknown as IDataObject,
|
||||||
);
|
);
|
||||||
|
} catch (error) {
|
||||||
|
if (error.response?.status === 413) {
|
||||||
|
throw new ResponseError(i18n.baseText('workflowRun.showError.payloadTooLarge'), {
|
||||||
|
errorCode: 413,
|
||||||
|
httpStatusCode: 413,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async removeTestWebhook(workflowId: string): Promise<boolean> {
|
async removeTestWebhook(workflowId: string): Promise<boolean> {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { parse } from 'flatted';
|
||||||
|
|
||||||
export const NO_NETWORK_ERROR_CODE = 999;
|
export const NO_NETWORK_ERROR_CODE = 999;
|
||||||
|
|
||||||
class ResponseError extends Error {
|
export class ResponseError extends Error {
|
||||||
// The HTTP status code of response
|
// The HTTP status code of response
|
||||||
httpStatusCode?: number;
|
httpStatusCode?: number;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue