refactor(config): 改进配置读取错误时输出的错误信息.

改进后的信息有助于让用户了解到底发生了什么, 可帮助用户找到出错的配置文件并修复错误的配置格式.
This commit is contained in:
2022-06-11 16:19:08 +08:00
parent ac0a398afc
commit 9c05726849
2 changed files with 16 additions and 6 deletions

View File

@ -108,7 +108,7 @@ internal class Launcher(private val config: AppConfig = Const.config) : AutoClos
@Synchronized
fun launch(): Boolean {
val botConfigs = loadBotConfig()
val botConfigs = loadBotConfig() ?: return false
if (botConfigs.isEmpty()) {
log.warn { "尚未配置任何机器人, 请先配置机器人后再启动本程序." }
return false