fix(error-handler): use HTTP 422 for validation errors

This commit is contained in:
Ali BARIN
2024-08-26 12:46:00 +00:00
parent 337ba6ea87
commit 5995038e21
3 changed files with 9 additions and 15 deletions

View File

@@ -17,7 +17,7 @@ const errorHandler = (error, request, response, next) => {
}
if (error instanceof ValidationError) {
renderObjectionError(response, error);
renderObjectionError(response, error, 422);
}
if (error instanceof DataError) {