From 35c038efa2f432e7bad8f9bcc54c7da550fdb9e7 Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Mon, 13 Jun 2022 11:05:16 +0800 Subject: [PATCH] Update utils.py --- utils/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utils/utils.py b/utils/utils.py index ac151b84..7ce3044f 100755 --- a/utils/utils.py +++ b/utils/utils.py @@ -5,6 +5,7 @@ from configs.config import SYSTEM_PROXY, Config from typing import List, Union, Optional, Type, Any from nonebot.adapters.onebot.v11 import Bot, Message from nonebot.matcher import matchers, Matcher +from services.log import logger from pathlib import Path import httpx import nonebot @@ -412,5 +413,6 @@ def change_img_md5(path_file: Union[str, Path]) -> bool: with open(path_file, "a") as f: f.write(str(int(time.time() * 1000))) return True - except: + except Exception as e: + logger.warning(f"改变图片MD5发生错误 {type(e)}:{e} Path:{path_file}") return False