From a0344f251f6f487369fad04d1f1ef1528c842465 Mon Sep 17 00:00:00 2001 From: LamGC Date: Thu, 10 Mar 2022 13:33:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=A0=E6=9F=90?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=9C=BA=E5=99=A8=E4=BA=BA=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E8=80=8C=E5=AF=BC=E8=87=B4=E6=95=B4=E4=B8=AA?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=B4=A9=E6=BA=83.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 改动之后, 将容忍机器人的启动失败, 而不会因此异常退出程序. --- scalabot-app/src/main/kotlin/AppMain.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scalabot-app/src/main/kotlin/AppMain.kt b/scalabot-app/src/main/kotlin/AppMain.kt index 09e49ab..00cb7a5 100644 --- a/scalabot-app/src/main/kotlin/AppMain.kt +++ b/scalabot-app/src/main/kotlin/AppMain.kt @@ -62,7 +62,11 @@ internal class Launcher : AutoCloseable { return false } for (botConfig in botConfigs) { - launchBot(botConfig) + try { + launchBot(botConfig) + } catch (e: Exception) { + log.error(e) { "机器人 `${botConfig.account.name}` 启动时发生错误." } + } } return true }