feat: global exception 수정
This commit is contained in:
parent
a98e2c73eb
commit
62dde35a66
@ -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) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user