feat: global exception 수정

This commit is contained in:
박정민 2024-07-31 11:07:11 +09:00
parent a98e2c73eb
commit 62dde35a66
2 changed files with 3 additions and 3 deletions

View File

@ -8,8 +8,8 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
@ControllerAdvice @ControllerAdvice
public class GlobalExceptionHandler { public class GlobalExceptionHandler {
@ExceptionHandler(UnAuthorizedException.class) @ExceptionHandler(InvalidTokenException.class)
public ResponseEntity<String> handleUnAuthorizedException(UnAuthorizedException e) { public ResponseEntity<String> handleUnAuthorizedException(InvalidTokenException e) {

View File

@ -95,7 +95,7 @@ public class JWTUtil {
} }
catch (Exception e) { catch (Exception e) {
log.error("Failed to get user ID from token: {}", e.getMessage()); log.error("Failed to get user ID from token: {}", e.getMessage());
throw new UnAuthorizedException(); throw new InvalidTokenException();
} }
} }
} }