From dac1a6f769394f6804ac652fac3a6908314529ff Mon Sep 17 00:00:00 2001 From: DrSmoothl <1787882683@qq.com> Date: Sat, 15 Mar 2025 12:24:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A3=80=E6=9F=A5=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=96=87=E4=BB=B6=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webui.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webui.py b/webui.py index 22d858842..6cc2fa0c8 100644 --- a/webui.py +++ b/webui.py @@ -10,7 +10,11 @@ import json is_share = False debug = True -config_data = toml.load("config/bot_config.toml") +try: + config_data = toml.load("config/bot_config.toml") +except Exception as e: + logger.error(f"读取配置文件失败,请检查配置文件是否存在,错误信息为:{e}") + sys.exit(1) CONFIG_VERSION = config_data["inner"]["version"] PARSED_CONFIG_VERSION = float(CONFIG_VERSION[2:])