From 6392ee627fcab6db439e6c859bd2475eccad8970 Mon Sep 17 00:00:00 2001 From: InfinityPacer <160988576+InfinityPacer@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:36:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=AF=B7=E6=B1=82=E5=A4=B1=E8=B4=A5?= =?UTF-8?q?=E6=97=B6=E8=AE=B0=E5=BD=95debug=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/utils/http.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/utils/http.py b/app/utils/http.py index fa92f337..6f76082f 100644 --- a/app/utils/http.py +++ b/app/utils/http.py @@ -6,6 +6,8 @@ import urllib3 from requests import Session, Response from urllib3.exceptions import InsecureRequestWarning +from app.log import logger + urllib3.disable_warnings(InsecureRequestWarning) @@ -71,7 +73,8 @@ class RequestUtils: kwargs.setdefault("stream", False) try: return req_method(method, url, **kwargs) - except requests.exceptions.RequestException: + except requests.exceptions.RequestException as e: + logger.debug(f"请求失败: {e}") if raise_exception: raise return None