Skip to content

Commit b604d9c

Browse files
committed
[BOOK-367] feat: 로그인 세션 만료 에러 핸들링 추가
1 parent 125fc7a commit b604d9c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package com.ninecraft.booket.core.common.constants
22

33
enum class ErrorScope {
4-
GLOBAL, LOGIN
4+
GLOBAL, LOGIN, AUTH_SESSION_EXPIRED,
55
}

core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/HandleException.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ fun handleException(
2323
) {
2424
when {
2525
exception is HttpException && exception.code() == 401 -> {
26-
onLoginRequired()
26+
postErrorDialog(
27+
errorScope = ErrorScope.AUTH_SESSION_EXPIRED,
28+
exception = exception,
29+
action = {
30+
onLoginRequired()
31+
}
32+
)
2733
}
2834

2935
exception is HttpException -> {
@@ -66,6 +72,10 @@ fun postErrorDialog(
6672
val loginErrorTitle = "로그인 오류"
6773
loginErrorTitle to "예기치 않은 오류가 발생했습니다.\n다시 로그인 해주세요."
6874
}
75+
76+
ErrorScope.AUTH_SESSION_EXPIRED -> {
77+
null to "세션이 만료되었어요.\n다시 로그인 해주세요"
78+
}
6979
}
7080
}
7181

0 commit comments

Comments
 (0)