server deps major updates 2
This commit is contained in:
parent
9a0e3952ce
commit
e8e1384b65
@ -23,7 +23,11 @@ function createServer() {
|
||||
|
||||
server.setErrorHandler((error, req, res) => {
|
||||
req.log.error(error.toString());
|
||||
res.code(500).send({ error: error.toString() });
|
||||
let statusCode = 500;
|
||||
if ('validation' in error) {
|
||||
statusCode = 400;
|
||||
}
|
||||
res.code(statusCode).send({ error: error.toString() });
|
||||
});
|
||||
return server;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user