fix: Display readable error when manual executions contains large payload (#8834)
This commit is contained in:
@@ -82,6 +82,8 @@ import { useNodeTypesStore } from '@/stores/nodeTypes.store';
|
||||
import { useUsersStore } from '@/stores/users.store';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { getCredentialOnlyNodeTypeName } from '@/utils/credentialOnlyNodes';
|
||||
import { ResponseError } from '@/utils/apiUtils';
|
||||
import { i18n } from '@/plugins/i18n';
|
||||
|
||||
const defaults: Omit<IWorkflowDb, 'id'> & { settings: NonNullable<IWorkflowDb['settings']> } = {
|
||||
name: '',
|
||||
@@ -1338,12 +1340,22 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
|
||||
async runWorkflow(startRunData: IStartRunData): Promise<IExecutionPushResponse> {
|
||||
const rootStore = useRootStore();
|
||||
return await makeRestApiRequest(
|
||||
rootStore.getRestApiContext,
|
||||
'POST',
|
||||
'/workflows/run',
|
||||
startRunData as unknown as IDataObject,
|
||||
);
|
||||
try {
|
||||
return await makeRestApiRequest(
|
||||
rootStore.getRestApiContext,
|
||||
'POST',
|
||||
'/workflows/run',
|
||||
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> {
|
||||
|
||||
Reference in New Issue
Block a user