Skip to content

Commit

Permalink
fix: error logger catchall
Browse files Browse the repository at this point in the history
  • Loading branch information
Tymek committed Oct 24, 2024
1 parent 589d9f1 commit d58214c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,6 @@ export default async function getApp(
services.openApiService.useErrorHandler(app);
}

if (process.env.NODE_ENV !== 'production') {
app.use(errorHandler());
} else {
app.use(catchAllErrorHandler(config.getLogger));
}

app.get(`${baseUriPath}`, (req, res) => {
res.set('Content-Type', 'text/html');
res.send(indexHTML);
Expand All @@ -229,5 +223,11 @@ export default async function getApp(
res.send(indexHTML);
});

if (process.env.NODE_ENV !== 'production') {
app.use(errorHandler());
} else {
app.use(catchAllErrorHandler(config.getLogger));
}

return app;
}

0 comments on commit d58214c

Please sign in to comment.