mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
Compare commits
3 Commits
886c4e5327
...
ae4f56fa42
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae4f56fa42 | ||
|
|
3a03810bcb | ||
|
|
d528711641 |
@ -1 +1 @@
|
|||||||
__version__: v0.2.4-da6d5b4
|
__version__: v0.2.4-d528711
|
||||||
|
|||||||
@ -263,6 +263,18 @@ class AsyncHttpx:
|
|||||||
)
|
)
|
||||||
return result
|
return result
|
||||||
except Exception as e:
|
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)
|
exceptions.append(e)
|
||||||
if url != url_list[-1]:
|
if url != url_list[-1]:
|
||||||
logger.warning(
|
logger.warning(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user