diff --git a/src/main/java/org/sopt/sopkerton/common/response/CommonControllerAdvice.java b/src/main/java/org/sopt/sopkerton/common/response/CommonControllerAdvice.java index cbe91ce..09324c4 100644 --- a/src/main/java/org/sopt/sopkerton/common/response/CommonControllerAdvice.java +++ b/src/main/java/org/sopt/sopkerton/common/response/CommonControllerAdvice.java @@ -2,6 +2,7 @@ import lombok.RequiredArgsConstructor; +import org.sopt.sopkerton.common.exception.base.ErrorBase; import org.sopt.sopkerton.common.exception.base.ExceptionBase; import org.springframework.http.ResponseEntity; @@ -14,10 +15,11 @@ public class CommonControllerAdvice { @ExceptionHandler(value = ExceptionBase.class) public ResponseEntity sopkathonExceptionHandler(ExceptionBase exception) { + ErrorBase error = exception.getError(); return ResponseEntity - .status(exception.getStatus()) + .status(error.getHttpStatus()) .body( - ApiResponse.error(exception.getErrorBase(), exception) + ApiResponse.error(error) ); }