mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor: Improve error logging/reporting for cli (#4691)
* use response error classes instead of `ResponseError` everywhere * improve error logging in dev mode or when telemetry is disabled
This commit is contained in:
committed by
GitHub
parent
5364e7fc92
commit
0b754a4f85
@@ -191,10 +191,8 @@ export class ActiveWorkflowRunner {
|
||||
): Promise<IResponseCallbackData> {
|
||||
Logger.debug(`Received webhook "${httpMethod}" for path "${path}"`);
|
||||
if (this.activeWorkflows === null) {
|
||||
throw new ResponseHelper.ResponseError(
|
||||
throw new ResponseHelper.NotFoundError(
|
||||
'The "activeWorkflows" instance did not get initialized yet.',
|
||||
404,
|
||||
404,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -224,10 +222,8 @@ export class ActiveWorkflowRunner {
|
||||
});
|
||||
if (dynamicWebhooks === undefined || dynamicWebhooks.length === 0) {
|
||||
// The requested webhook is not registered
|
||||
throw new ResponseHelper.ResponseError(
|
||||
throw new ResponseHelper.NotFoundError(
|
||||
`The requested webhook "${httpMethod} ${path}" is not registered.`,
|
||||
404,
|
||||
404,
|
||||
WEBHOOK_PROD_UNREGISTERED_HINT,
|
||||
);
|
||||
}
|
||||
@@ -252,10 +248,8 @@ export class ActiveWorkflowRunner {
|
||||
}
|
||||
});
|
||||
if (webhook === undefined) {
|
||||
throw new ResponseHelper.ResponseError(
|
||||
throw new ResponseHelper.NotFoundError(
|
||||
`The requested webhook "${httpMethod} ${path}" is not registered.`,
|
||||
404,
|
||||
404,
|
||||
WEBHOOK_PROD_UNREGISTERED_HINT,
|
||||
);
|
||||
}
|
||||
@@ -277,10 +271,8 @@ export class ActiveWorkflowRunner {
|
||||
relations: ['shared', 'shared.user', 'shared.user.globalRole'],
|
||||
});
|
||||
if (workflowData === undefined) {
|
||||
throw new ResponseHelper.ResponseError(
|
||||
throw new ResponseHelper.NotFoundError(
|
||||
`Could not find workflow with id "${webhook.workflowId}"`,
|
||||
404,
|
||||
404,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -313,7 +305,7 @@ export class ActiveWorkflowRunner {
|
||||
const workflowStartNode = workflow.getNode(webhookData.node);
|
||||
|
||||
if (workflowStartNode === null) {
|
||||
throw new ResponseHelper.ResponseError('Could not find node to process webhook.', 404, 404);
|
||||
throw new ResponseHelper.NotFoundError('Could not find node to process webhook.');
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
Reference in New Issue
Block a user