1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: error logger catchall

This commit is contained in:
Tymoteusz Czech 2024-10-24 13:08:25 +02:00
parent 589d9f1af7
commit d58214cedd
No known key found for this signature in database
GPG Key ID: 133555230D88D75F

View File

@ -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);
@ -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;
}