fix(avatar): fail closed on BOXIM connection errors

This commit is contained in:
stefanfeng
2026-08-20 14:47:13 +08:00
parent 08590bf9ea
commit 51a317ccd9
7 changed files with 173 additions and 17 deletions
@@ -97,7 +97,18 @@ class BoxIMClient:
payload.get("message") or "BOXIM 授权失败",
code=code or response.status_code,
auth_error=response.status_code in (400, 401, 403)
or code in (400, 401, 40100, 403, "400", "401", "40100", "403"),
or code in (
400,
401,
40100,
40101,
403,
"400",
"401",
"40100",
"40101",
"403",
),
)
if not data.get("accessToken"):
raise BoxIMError("会会未返回 BOXIM 访问凭证", auth_error=True)
@@ -128,7 +139,7 @@ class BoxIMClient:
payload.get("message") or "BOXIM 请求失败",
code=code or response.status_code,
auth_error=response.status_code in (400, 401, 403)
or code in (400, 401, 403, "400", "401", "403"),
or code in (400, 401, 40100, 40101, 403, "400", "401", "40100", "40101", "403"),
)
return payload.get("data")