From d6c582e62be065b2b9590a8137a4c3b1acf5b56e Mon Sep 17 00:00:00 2001 From: Suyash Garg Date: Tue, 14 May 2019 18:20:30 +0200 Subject: [PATCH] Handle UnableProcessException with 422 --- .../nakadi/controller/advice/CursorsExceptionHandler.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/zalando/nakadi/controller/advice/CursorsExceptionHandler.java b/src/main/java/org/zalando/nakadi/controller/advice/CursorsExceptionHandler.java index 13640a5120..1aa6847c8a 100644 --- a/src/main/java/org/zalando/nakadi/controller/advice/CursorsExceptionHandler.java +++ b/src/main/java/org/zalando/nakadi/controller/advice/CursorsExceptionHandler.java @@ -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) @@ -30,7 +29,7 @@ public class CursorsExceptionHandler implements AdviceTrait { public ResponseEntity 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)