Skip to content

Commit

Permalink
[FEAT] AuthException 뿐만 아니라 서비스 내에서 정의된 모든 Exception을 핸들링하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
sung-silver committed Jan 17, 2025
1 parent 0d73206 commit 8367fab
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static sopt.makers.authentication.support.code.support.failure.CommonFailure.INTERNAL_SERVER_ERROR;

import sopt.makers.authentication.support.common.api.BaseResponse;
import sopt.makers.authentication.support.exception.domain.AuthException;
import sopt.makers.authentication.support.exception.base.*;

import org.springframework.http.*;
import org.springframework.web.bind.annotation.ExceptionHandler;
Expand All @@ -21,8 +21,8 @@ ResponseEntity<BaseResponse<?>> handleInternalException(final RuntimeException e
.body(BaseResponse.ofFailure(INTERNAL_SERVER_ERROR));
}

@ExceptionHandler(AuthException.class)
ResponseEntity<BaseResponse<?>> handleAuthException(final AuthException e) {
@ExceptionHandler(BaseException.class)
ResponseEntity<BaseResponse<?>> handleBusinessException(final BaseException e) {
log.error(e.getError().getMessage());
return ResponseEntity.status(e.getError().getStatus().value())
.body(BaseResponse.ofFailure(e.getError()));
Expand Down

0 comments on commit 8367fab

Please sign in to comment.