Skip to content

Commit

Permalink
fix: error with this pointing to ErrorHandlerMiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAlbDR committed Mar 28, 2024
1 parent f1116a4 commit 190940f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/presentation/middlewares/error-handler.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ErrorHandlerMiddleware {
*/
constructor() {}

handle(err: Error, _req: Request, res: Response, _next: NextFunction) {
handle = (err: Error, _req: Request, res: Response, _next: NextFunction) => {
console.log({ err });

let message, statusCode;
Expand Down Expand Up @@ -55,5 +55,5 @@ export class ErrorHandlerMiddleware {
name: err?.name || 'Error',
message: message || err?.message,
});
}
};
}

0 comments on commit 190940f

Please sign in to comment.