fix: 修复因某一个机器人启动失败而导致整个程序崩溃.

改动之后, 将容忍机器人的启动失败, 而不会因此异常退出程序.
This commit is contained in:
LamGC 2022-03-10 13:33:57 +08:00
parent 84b67c7f89
commit a0344f251f
Signed by: LamGC
GPG Key ID: 6C5AE2A913941E1D

View File

@ -62,7 +62,11 @@ internal class Launcher : AutoCloseable {
return false return false
} }
for (botConfig in botConfigs) { for (botConfig in botConfigs) {
launchBot(botConfig) try {
launchBot(botConfig)
} catch (e: Exception) {
log.error(e) { "机器人 `${botConfig.account.name}` 启动时发生错误." }
}
} }
return true return true
} }