fix plugin 403 msg

This commit is contained in:
thsrite 2024-04-23 16:16:39 +08:00
parent b0f7a11328
commit c8a1e59310

View File

@ -135,7 +135,8 @@ class PluginHelper(metaclass=Singleton):
if r is None:
return None, "连接仓库失败"
elif r.status_code != 200:
return None, f"连接仓库失败:{r.status_code} - {r.reason}"
return None, f"连接仓库失败:{r.status_code} - " \
f"{'超出速率限制请配置GITHUB_TOKEN环境变量或稍后重试' if r.status_code == 403 else r.reason}"
ret = r.json()
if ret and ret[0].get("message") == "Not Found":
return None, "插件在仓库中不存在"