🚀 增加资源下载失败异常处理及提示信息

This commit is contained in:
Flern 2024-12-30 17:40:46 +08:00
parent 603ad5bc8b
commit ec6ad1408e

View File

@ -70,6 +70,10 @@ class ResourceManager:
url = await repo_info.get_archive_download_urls()
logger.debug("开始下载resources资源包...", CMD_STRING)
if not await AsyncHttpx.download_file(url, cls.ZIP_FILE, stream=True):
logger.error(
"下载resources资源包失败请尝试重启重新下载或前往 "
"https://github.com/zhenxun-org/zhenxun-bot-resources 手动下载..."
)
raise DownloadResourceException("下载resources资源包失败...")
logger.debug("下载resources资源文件压缩包完成...", CMD_STRING)
tf = zipfile.ZipFile(cls.ZIP_FILE)