mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-14 21:52:56 +08:00
Compare commits
2 Commits
54d8bbeb53
...
3a03810bcb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a03810bcb | ||
|
|
d528711641 |
@ -1 +1 @@
|
||||
__version__: v0.2.4-da6d5b4
|
||||
__version__: v0.2.4-d528711
|
||||
|
||||
@ -263,6 +263,18 @@ class AsyncHttpx:
|
||||
)
|
||||
return result
|
||||
except Exception as e:
|
||||
if isinstance(e, HTTPStatusError):
|
||||
status = getattr(e.response, "status_code", "?")
|
||||
try:
|
||||
body_text = getattr(e.response, "text", None)
|
||||
if body_text is not None and len(body_text) > 2000:
|
||||
body_text = body_text[:2000] + "...(truncated)"
|
||||
except Exception:
|
||||
body_text = "<unavailable>"
|
||||
logger.debug(
|
||||
f"请求失败: {url} {status} {body_text}",
|
||||
"AsyncHttpx:FallbackExecutor",
|
||||
)
|
||||
exceptions.append(e)
|
||||
if url != url_list[-1]:
|
||||
logger.warning(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user