异常派发修复注释
This commit is contained in:
@@ -151,7 +151,9 @@ class YDAPI:
|
||||
|
||||
try:
|
||||
res = requests.post(api, headers=headers, json=formData)
|
||||
res.raise_for_status() # 如果返回状态码不是2xx,抛出异常
|
||||
logger.info(f"HTTP Status Code: {res.status_code}")
|
||||
logger.info(f"Response Headers: {dict(res.headers)}")
|
||||
logger.info(f"Raw Response Text: {res.text}") # 注意:不要在线上环境打印敏感数据!
|
||||
return res.json()
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
|
||||
Reference in New Issue
Block a user