Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Handle UnableProcessException with 422
Browse files Browse the repository at this point in the history
  • Loading branch information
ferbncode committed May 14, 2019
1 parent 47a4223 commit d6c582e
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import javax.annotation.Priority;

import static org.zalando.problem.Status.CONFLICT;
import static org.zalando.problem.Status.SERVICE_UNAVAILABLE;
import static org.zalando.problem.Status.UNPROCESSABLE_ENTITY;

@Priority(10)
Expand All @@ -30,7 +29,7 @@ public class CursorsExceptionHandler implements AdviceTrait {
public ResponseEntity<Problem> handleUnableProcessException(final UnableProcessException exception,
final NativeWebRequest request) {
LOG.error(exception.getMessage(), exception);
return create(Problem.valueOf(SERVICE_UNAVAILABLE, exception.getMessage()), request);
return create(Problem.valueOf(UNPROCESSABLE_ENTITY, exception.getMessage()), request);
}

@ExceptionHandler(MethodArgumentNotValidException.class)
Expand Down

0 comments on commit d6c582e

Please sign in to comment.