Skip to content

Commit

Permalink
add error message in the logger
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalguptaofficial committed Jan 20, 2025
1 parent c37d29c commit f1bfc68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/handlers/request_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit f1bfc68

Please sign in to comment.