wechatbot-sdk 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/PKG-INFO +1 -1
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/pyproject.toml +1 -1
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/wechatbot/protocol.py +4 -3
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/.gitignore +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/README.md +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/examples/echo_bot.py +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/tests/test_client.py +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/tests/test_crypto.py +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/wechatbot/__init__.py +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/wechatbot/auth.py +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/wechatbot/client.py +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/wechatbot/crypto.py +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/wechatbot/errors.py +0 -0
- {wechatbot_sdk-0.2.0 → wechatbot_sdk-0.2.1}/wechatbot/types.py +0 -0
|
@@ -85,9 +85,10 @@ async def _parse_response(resp: aiohttp.ClientResponse, label: str) -> dict[str,
|
|
|
85
85
|
)
|
|
86
86
|
|
|
87
87
|
ret = payload.get("ret")
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
errcode = payload.get("errcode")
|
|
89
|
+
if (isinstance(ret, int) and ret != 0) or (isinstance(errcode, int) and errcode != 0):
|
|
90
|
+
code = errcode if isinstance(errcode, int) and errcode != 0 else (ret or 0)
|
|
91
|
+
msg = payload.get("errmsg") or f"{label} failed (ret={ret} errcode={errcode})"
|
|
91
92
|
raise ApiError(msg, http_status=resp.status, errcode=code, payload=payload)
|
|
92
93
|
|
|
93
94
|
return payload
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|