summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2022-06-25 21:01:44 +0800
committerKyomotoi <[email protected]>2022-06-25 21:01:44 +0800
commit37df264d7e9acb624767bdb654eed01d49137aa3 (patch)
treec866b73cde36139d515d530d889976f4b84171a2
parenta96f0453fb111ef105224ef3cc003c60b940c349 (diff)
downloadATRI-37df264d7e9acb624767bdb654eed01d49137aa3.tar.gz
ATRI-37df264d7e9acb624767bdb654eed01d49137aa3.tar.bz2
ATRI-37df264d7e9acb624767bdb654eed01d49137aa3.zip
🚑️ 修复启动时因可能的报错导致强制退出
-rw-r--r--ATRI/plugins/polaroid/data_source.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ATRI/plugins/polaroid/data_source.py b/ATRI/plugins/polaroid/data_source.py
index a90d148..5b42e95 100644
--- a/ATRI/plugins/polaroid/data_source.py
+++ b/ATRI/plugins/polaroid/data_source.py
@@ -46,13 +46,13 @@ async def init_source():
log.warning("插件 polaroid 缺少所需资源,装载中")
url = SOURCE_URL + i
- data = await request.get(url)
try:
+ data = await request.get(url)
with open(path, "wb") as w:
w.write(data.read())
log.info("所需资源装载完成")
except Exception:
- raise WriteFileError("装载资源失败")
+ log.error("装载资源失败")
driver().on_startup(init_source)