Skip to content

fix: 接口出错时只显示 hub 的中文文案,反代错误页与断网按状态说明 - #13

Merged
stqfdyr merged 1 commit into
mainfrom
fix/error-messages
Sep 24, 2026
Merged

stqfdyr merged 1 commit into
mainfrom
fix/error-messages

Conversation

@stqfdyr

@stqfdyr stqfdyr commented Sep 24, 2026

Copy link
Copy Markdown
Contributor
  • api():只把 text/plain 的错误回复当 hub 的话原样显示;反代或 CDN 的错误页(如 nginx 的 502、Cloudflare 的拦截页)不再把 HTML 显示给访客,按状态码说明「服务暂时无法访问」或「请求被拦截」
  • 断网提示「网络连接失败,稍后再试」;返回 200 却不是 JSON 提示「收到的不是状态数据」
  • 错误信息不再可能是空串,去掉 App.tsx、NodeDetail.tsx 两处 || "网络错误" 兜底

配合 monitor-probe/monitor#63:hub 的错误回复改为一行中文纯文本。

测试

  • tsc -b、oxlint、npm test 通过

不是 text/plain 的错误回复来自反代或 CDN,不再把它的 HTML 显示给访客;断网、
200 却不是 JSON 也给出中文说明。错误信息不会再是空串,去掉两处兜底。
@stqfdyr
stqfdyr merged commit cb7d147 into main Sep 24, 2026
1 check passed
@stqfdyr
stqfdyr deleted the fix/error-messages branch September 24, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant