Skip to content

Commit

Permalink
Merge pull request #107 from kukume/fix1
Browse files Browse the repository at this point in the history
catch exception in websocket
  • Loading branch information
ForteScarlet authored Sep 6, 2024
2 parents b90032e + 3d09ef7 commit 553b8dc
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,12 @@ internal class OneBotBotImpl(
}

// 等待关闭完成
val reason = currentSession.closeReason.await()
val reason = kotlin.runCatching {
currentSession.closeReason.await()
}.getOrElse { e ->
logger.debug("Failed to get close reason for session: {}", e.message, e)
null
}
logger.debug("Session {} done. The reason: {}", currentSession, reason)
}

Expand Down

0 comments on commit 553b8dc

Please sign in to comment.