Skip to content

Commit d23544f

Browse files
committed
catch exception in websocket
1 parent b90032e commit d23544f

File tree

1 file changed

+3
-1
lines changed
  • simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/internal

1 file changed

+3
-1
lines changed

simbot-component-onebot-v11/simbot-component-onebot-v11-core/src/commonMain/kotlin/love/forte/simbot/component/onebot/v11/core/bot/internal/OneBotBotImpl.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,9 @@ internal class OneBotBotImpl(
426426
}
427427

428428
// 等待关闭完成
429-
val reason = currentSession.closeReason.await()
429+
val reason = kotlin.runCatching {
430+
currentSession.closeReason.await()
431+
}.getOrNull()
430432
logger.debug("Session {} done. The reason: {}", currentSession, reason)
431433
}
432434

0 commit comments

Comments
 (0)