From c8090f7ed787a698f3e800068f265badfee9a608 Mon Sep 17 00:00:00 2001 From: BalconyJH Date: Mon, 14 Apr 2025 23:30:02 +0800 Subject: [PATCH] :alien: Rename exception for missing database URL in initialization --- zhenxun/services/db_context.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zhenxun/services/db_context.py b/zhenxun/services/db_context.py index 65697f32..4bc350c5 100644 --- a/zhenxun/services/db_context.py +++ b/zhenxun/services/db_context.py @@ -165,7 +165,7 @@ class Model(TortoiseModel): await CacheRoot.reload(cache_type) -class DbUrlIsNode(Exception): +class DbUrlMissing(Exception): """ 数据库链接地址为空 """ @@ -183,7 +183,7 @@ class DbConnectError(Exception): async def init(): if not BotConfig.db_url: - raise DbUrlIsNode("数据库配置为空,请在.env.dev中配置DB_URL...") + raise DbUrlMissing("数据库配置为空,请在.env.dev中配置DB_URL...") try: await Tortoise.init( db_url=BotConfig.db_url,