mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
chore(core): Log failed webhook requests with debug (no-changelog) (#12599)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
This commit is contained in:
parent
c2569a0607
commit
a0b7cac3a5
|
@ -1,5 +1,7 @@
|
||||||
|
import { Container } from '@n8n/di';
|
||||||
import type express from 'express';
|
import type express from 'express';
|
||||||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
import { Logger } from 'n8n-core';
|
||||||
|
import { ensureError, type IHttpRequestMethods } from 'n8n-workflow';
|
||||||
|
|
||||||
import * as ResponseHelper from '@/response-helper';
|
import * as ResponseHelper from '@/response-helper';
|
||||||
import type {
|
import type {
|
||||||
|
@ -52,8 +54,14 @@ class WebhookRequestHandler {
|
||||||
response.headers,
|
response.headers,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (e) {
|
||||||
return ResponseHelper.sendErrorResponse(res, error as Error);
|
const error = ensureError(e);
|
||||||
|
Container.get(Logger).debug(
|
||||||
|
`Error in handling webhook request ${req.method} ${req.path}: ${error.message}`,
|
||||||
|
{ stacktrace: error.stack },
|
||||||
|
);
|
||||||
|
|
||||||
|
return ResponseHelper.sendErrorResponse(res, error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue