diff --git a/bootstrap/api/src/main/kotlin/com/threedays/bootstrap/api/support/exception/ControllerAdvice.kt b/bootstrap/api/src/main/kotlin/com/threedays/bootstrap/api/support/exception/ControllerAdvice.kt index e3c6328..440d025 100644 --- a/bootstrap/api/src/main/kotlin/com/threedays/bootstrap/api/support/exception/ControllerAdvice.kt +++ b/bootstrap/api/src/main/kotlin/com/threedays/bootstrap/api/support/exception/ControllerAdvice.kt @@ -1,5 +1,6 @@ package com.threedays.bootstrap.api.support.exception +import com.threedays.domain.auth.exception.AuthException import com.threedays.oas.model.ErrorResponse import com.threedays.support.common.base.exception.CustomException import com.threedays.support.common.exception.NotFoundException @@ -23,6 +24,15 @@ class ControllerAdvice { } + @ExceptionHandler(AuthException.RefreshTokenExpiredException::class) + fun handleRefreshTokenExpiredException(e: AuthException.RefreshTokenExpiredException): ResponseEntity { + logger.error(e) { "RefreshTokenExpiredException" } + + val response: ErrorResponse = createErrorResponse(e.type, e.code) + + return createResponseEntity(HttpStatus.UNAUTHORIZED, response) + } + @ExceptionHandler(CustomException::class) fun handleCustomException(e: CustomException): ResponseEntity { logger.error(e) { "CustomException" }