👽 Rename exception for missing database URL in initialization

This commit is contained in:
BalconyJH 2025-04-14 23:30:02 +08:00
parent 99e09caf24
commit c8090f7ed7
No known key found for this signature in database

View File

@ -165,7 +165,7 @@ class Model(TortoiseModel):
await CacheRoot.reload(cache_type) await CacheRoot.reload(cache_type)
class DbUrlIsNode(Exception): class DbUrlMissing(Exception):
""" """
数据库链接地址为空 数据库链接地址为空
""" """
@ -183,7 +183,7 @@ class DbConnectError(Exception):
async def init(): async def init():
if not BotConfig.db_url: if not BotConfig.db_url:
raise DbUrlIsNode("数据库配置为空,请在.env.dev中配置DB_URL...") raise DbUrlMissing("数据库配置为空,请在.env.dev中配置DB_URL...")
try: try:
await Tortoise.init( await Tortoise.init(
db_url=BotConfig.db_url, db_url=BotConfig.db_url,