mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
chore(core): Log failed webhook requests with debug (no-changelog) (#12599)
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { Container } from '@n8n/di';
|
||||
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 type {
|
||||
@@ -52,8 +54,14 @@ class WebhookRequestHandler {
|
||||
response.headers,
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
return ResponseHelper.sendErrorResponse(res, error as Error);
|
||||
} catch (e) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user