From 58982c523c9206346232822a32745b985143caf1 Mon Sep 17 00:00:00 2001 From: minjungkim <97938489+pushedrumex@users.noreply.github.com> Date: Tue, 27 Feb 2024 09:08:12 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=84=9C=EB=B2=84=20=EB=82=B4?= =?UTF-8?q?=EB=B6=80=20=EC=98=A4=EB=A5=98=20=EB=B0=9C=EC=83=9D=20=EB=A1=9C?= =?UTF-8?q?=EA=B9=85=20=EC=B6=94=EA=B0=80=20(#52)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indp/domain/common/exception/ControllerAdvice.java | 6 ++++++ .../verby/indp/domain/store/controller/StoreController.java | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/verby/indp/domain/common/exception/ControllerAdvice.java b/src/main/java/com/verby/indp/domain/common/exception/ControllerAdvice.java index 913ef26..519c5f9 100644 --- a/src/main/java/com/verby/indp/domain/common/exception/ControllerAdvice.java +++ b/src/main/java/com/verby/indp/domain/common/exception/ControllerAdvice.java @@ -2,10 +2,12 @@ import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR; +import lombok.extern.slf4j.Slf4j; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RestControllerAdvice; +@Slf4j @RestControllerAdvice public class ControllerAdvice { @@ -16,6 +18,10 @@ public ResponseEntity handleBusinessException(BusinessException e @ExceptionHandler(Exception.class) public ResponseEntity handleException(Exception exception) { + String exName = exception.getClass().getSimpleName(); + String exMessage = exception.getMessage(); + log.error("[Exception] exName=[{}] exMessage=[{}]", exName, exMessage); + return ResponseEntity.status(INTERNAL_SERVER_ERROR).body(new ErrorResponse("알 수 없는 오류가 발생했습니다. 잠시 후 다시 시도해주세요.")); } diff --git a/src/main/java/com/verby/indp/domain/store/controller/StoreController.java b/src/main/java/com/verby/indp/domain/store/controller/StoreController.java index ffad587..ba4cc7d 100644 --- a/src/main/java/com/verby/indp/domain/store/controller/StoreController.java +++ b/src/main/java/com/verby/indp/domain/store/controller/StoreController.java @@ -25,7 +25,7 @@ public ResponseEntity findSimpleStores(Pageable pageab } @GetMapping("/stores") - public ResponseEntity findSimpleStores( + public ResponseEntity findStores( Pageable pageable, @RequestParam(name = "region", required = false) Region region ) {