fix(core): Better error message in Webhook node when using the POST method

This commit is contained in:
Michael Kret
2023-05-02 17:27:05 +03:00
committed by GitHub
parent 5364a2dff3
commit a0dd17e115
4 changed files with 72 additions and 5 deletions

View File

@@ -66,6 +66,7 @@ import { ExternalHooks } from '@/ExternalHooks';
import { whereClause } from './UserManagement/UserManagementHelper';
import { WorkflowsService } from './workflows/workflows.services';
import { START_NODES } from './constants';
import { webhookNotFoundErrorMessage } from './utils';
const WEBHOOK_PROD_UNREGISTERED_HINT =
"The workflow must be active for a production URL to run successfully. You can activate the workflow using the toggle in the top-right of the editor. Note that unlike test URL calls, production URL calls aren't shown on the canvas (only in the executions list)";
@@ -221,7 +222,7 @@ export class ActiveWorkflowRunner {
if (dynamicWebhooks === undefined || dynamicWebhooks.length === 0) {
// The requested webhook is not registered
throw new ResponseHelper.NotFoundError(
`The requested webhook "${httpMethod} ${path}" is not registered.`,
webhookNotFoundErrorMessage(path, httpMethod),
WEBHOOK_PROD_UNREGISTERED_HINT,
);
}
@@ -247,7 +248,7 @@ export class ActiveWorkflowRunner {
});
if (webhook === null) {
throw new ResponseHelper.NotFoundError(
`The requested webhook "${httpMethod} ${path}" is not registered.`,
webhookNotFoundErrorMessage(path, httpMethod),
WEBHOOK_PROD_UNREGISTERED_HINT,
);
}