Skip to content

Commit

Permalink
Add error message for 'userNameEncpt' missing
Browse files Browse the repository at this point in the history
  • Loading branch information
lhwdev committed Feb 28, 2022
1 parent 0b91658 commit b8186d1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/src/main/java/com/lhwdev/selfTestMacro/FirstActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,15 @@ class FirstActivity : AppCompatActivity() {
val token = result.token

val groups = tryAtMost(maxTrial = 3) {
session.getUserGroup(instituteInfo, token)
}
try {
session.getUserGroup(instituteInfo, token)
} catch(th: Throwable) {
if(th.message?.contains("userNameEncpt") == true) {
showToastSuspendAsync("아직 여러명의 자가진단은 지원하지 않습니다.")
null
} else throw th
}
} ?: return@main
singleOfUserGroup(groups) ?: return@main // TODO: many users

pref.institute = instituteInfo
Expand Down

0 comments on commit b8186d1

Please sign in to comment.