From 4de3eba11b42fa1e0387b0fa764d050545c257fe Mon Sep 17 00:00:00 2001 From: dtd1614 Date: Thu, 16 May 2024 19:06:42 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20ExceptionHandler=20=ED=81=B4=EB=9E=98?= =?UTF-8?q?=EC=8A=A4=EB=AA=85=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...GlobalExceptionHandler.java => ControllerAdvice.java} | 9 +++------ ...alExceptionHandler.java => RestControllerAdvice.java} | 5 ++--- 2 files changed, 5 insertions(+), 9 deletions(-) rename src/main/java/today/meevote/controllerAdvice/{GlobalExceptionHandler.java => ControllerAdvice.java} (70%) rename src/main/java/today/meevote/controllerAdvice/{RestGlobalExceptionHandler.java => RestControllerAdvice.java} (92%) diff --git a/src/main/java/today/meevote/controllerAdvice/GlobalExceptionHandler.java b/src/main/java/today/meevote/controllerAdvice/ControllerAdvice.java similarity index 70% rename from src/main/java/today/meevote/controllerAdvice/GlobalExceptionHandler.java rename to src/main/java/today/meevote/controllerAdvice/ControllerAdvice.java index 0c623b4..ee72424 100644 --- a/src/main/java/today/meevote/controllerAdvice/GlobalExceptionHandler.java +++ b/src/main/java/today/meevote/controllerAdvice/ControllerAdvice.java @@ -1,17 +1,14 @@ package today.meevote.controllerAdvice; import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.MethodArgumentNotValidException; -import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import today.meevote.exception.view.UnauthenticatedException; import today.meevote.exception.view.NotFoundException; -import today.meevote.response.BaseResponse; -import today.meevote.response.FailureInfo; + @Slf4j -@ControllerAdvice -public class GlobalExceptionHandler { +@org.springframework.web.bind.annotation.ControllerAdvice +public class ControllerAdvice { @ExceptionHandler(UnauthenticatedException.class) public String unauthenticatedException(UnauthenticatedException e){ diff --git a/src/main/java/today/meevote/controllerAdvice/RestGlobalExceptionHandler.java b/src/main/java/today/meevote/controllerAdvice/RestControllerAdvice.java similarity index 92% rename from src/main/java/today/meevote/controllerAdvice/RestGlobalExceptionHandler.java rename to src/main/java/today/meevote/controllerAdvice/RestControllerAdvice.java index d9f51f2..58618ae 100644 --- a/src/main/java/today/meevote/controllerAdvice/RestGlobalExceptionHandler.java +++ b/src/main/java/today/meevote/controllerAdvice/RestControllerAdvice.java @@ -5,13 +5,12 @@ import jakarta.validation.ConstraintViolationException; import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.RestControllerAdvice; import today.meevote.exception.rest.RestException; import today.meevote.response.BaseResponse; import today.meevote.response.FailureInfo; @Slf4j -@RestControllerAdvice -public class RestGlobalExceptionHandler { +@org.springframework.web.bind.annotation.RestControllerAdvice +public class RestControllerAdvice { @ExceptionHandler(Exception.class) protected BaseResponse internalSeverException(Exception e){