From f1bfc68cdd59141fdc950e78639d9c22e2ff73eb Mon Sep 17 00:00:00 2001 From: ujjwalgupta94 Date: Mon, 20 Jan 2025 23:25:15 +0530 Subject: [PATCH] add error message in the logger --- src/handlers/request_handler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/handlers/request_handler.ts b/src/handlers/request_handler.ts index c9f692e..a36f9b5 100644 --- a/src/handlers/request_handler.ts +++ b/src/handlers/request_handler.ts @@ -17,7 +17,9 @@ export class RequestHandler extends RequestHandlerHelper { private registerEvents_() { this.request.on('error', (err) => { - console.error(`Unexpected error occured`, err); + const errorArgs = [`Unexpected error occured`, err]; + console.error(...errorArgs); + this.config.logger.error(...errorArgs); this.onBadRequest(err).catch(ex => { this.onErrorOccured(ex); });