From 5cd4b14ea4fc9bcd1c7adc27899d4a70ad22e5bc Mon Sep 17 00:00:00 2001 From: dd Date: Fri, 15 May 2020 07:23:57 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=A6=AC=EB=B7=B0=20=EB=B0=98?= =?UTF-8?q?=EC=98=814?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 비즈니스 로직 에러와 DB접근에러 시 http 상태코드를 500이 아닌 400을 반환하도록 수정 --- .../subway/admin/controller/GlobalDefaultExceptionHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/wooteco/subway/admin/controller/GlobalDefaultExceptionHandler.java b/src/main/java/wooteco/subway/admin/controller/GlobalDefaultExceptionHandler.java index a45aa9a183..ac25be887e 100644 --- a/src/main/java/wooteco/subway/admin/controller/GlobalDefaultExceptionHandler.java +++ b/src/main/java/wooteco/subway/admin/controller/GlobalDefaultExceptionHandler.java @@ -23,7 +23,7 @@ protected ResponseEntity handleMethodArgumentNotValidException( @ExceptionHandler({BusinessException.class, DataAccessException.class}) protected ResponseEntity handleBusinessException(final Exception e) { final ErrorResponse response = new ErrorResponse(e.getMessage()); - return new ResponseEntity<>(response, HttpStatus.INTERNAL_SERVER_ERROR); + return new ResponseEntity<>(response, HttpStatus.BAD_REQUEST); } @ExceptionHandler(Exception.class)