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

Commit

Permalink
Merge pull request #1049 from zalando/fix-503
Browse files Browse the repository at this point in the history
Handle UnableProcessException with 422
  • Loading branch information
ferbncode authored May 15, 2019
2 parents 621f8a8 + d6c582e commit 7e02e81
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 7e02e81

Please sign in to comment.