[#20] 도메인별 예외 분리 #21

Merged
pricelees merged 37 commits from refactor/#20 into main 2025-07-24 02:48:53 +00:00
2 changed files with 3 additions and 1 deletions
Showing only changes of commit 95e952c215 - Show all commits

View File

@ -37,6 +37,8 @@ class JwtHandler(
.body
.get(MEMBER_ID_CLAIM_KEY, Number::class.java)
.toLong()
} catch (_: IllegalArgumentException) {
throw AuthException(AuthErrorCode.TOKEN_NOT_FOUND)
} catch (_: ExpiredJwtException) {
throw AuthException(AuthErrorCode.EXPIRED_TOKEN)
} catch (_: Exception) {

View File

@ -41,7 +41,7 @@ class JwtHandlerTest : FunSpec({
test("토큰이 빈 값이면 예외를 던진다.") {
shouldThrow<AuthException> {
jwtHandler.getMemberIdFromToken("")
}.errorCode shouldBe AuthErrorCode.INVALID_TOKEN
}.errorCode shouldBe AuthErrorCode.TOKEN_NOT_FOUND
}
test("시크릿 키가 잘못된 경우 예외를 던진다.") {