Skip to content

Commit

Permalink
server: Minimize not found logs (closes #505)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Oct 19, 2024
1 parent 69266d8 commit e311681
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/routes/error_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,10 @@ function register(app: Application) {

// error handler
app.use((err: any, req: Request, res: Response, next: NextFunction) => {
if (err && err.message && (
(err.message.includes("Router not found for request") && err.message.includes(".js.map"))
|| (err.message.includes("Router not found for request") && err.message.includes(".css.map"))
)) {
// ignore
} else {
if (err.status !== 404) {
log.info(err);
} else {
log.info(`${err.status} ${req.method} ${req.url}`);
}

res.status(err.status || 500);
Expand Down

0 comments on commit e311681

Please sign in to comment.