Commit 4dc83e80 authored by Agustin Ruiz Diaz Cambon's avatar Agustin Ruiz Diaz Cambon
Browse files

ValidationError message fix(should be refactored)

parent e3a21426
Pipeline #15997 passed with stage
in 1 minute and 44 seconds
......@@ -44,7 +44,13 @@ app.use((error: Error, request: Request, response: Response, next: NextFunction)
// Check the error is a validation error
if (error instanceof ValidationError) {
// TODO: Handle error message accordingly
let msg: string | undefined;
if (error.validationErrors.body && error.validationErrors.body[0]) {
msg = error.validationErrors.body[0].message;
if (msg) {
} else {
// Pass error on if not a validation error
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment