Skip to content

feat(cliproxy): 日志面板展示后端透传的具体错误原因#201

Merged
g1331 merged 1 commit into
masterfrom
hotfix/cliproxy-logs-error-detail
May 31, 2026
Merged

feat(cliproxy): 日志面板展示后端透传的具体错误原因#201
g1331 merged 1 commit into
masterfrom
hotfix/cliproxy-logs-error-detail

Conversation

@g1331

@g1331 g1331 commented May 31, 2026

Copy link
Copy Markdown
Owner

Summary

接 PR #200:v0.5.1 已经把 CLIProxyAPI 上游 4xx 的错误正文拼到 CliproxyManagementApiError.message 上,但前端日志面板仍只展示通用的 logsLoadFailed 文案,把真正的根因(如 logging to file disabled)吞掉。

现在 panel 在 isError 时额外展示 error.message —— 例如 CLIProxyAPI 端未启用 LoggingToFile 时,用户能直接在 UI 上看到 "logging to file disabled",不再需要去翻后端日志才知道为什么 502。

Changes

  • src/components/admin/cliproxy-instance-logs-panel.tsx:错误态新增第二行展示 error.message,灰字、可换行
  • 同步组件测试覆盖:错误带 message 时被渲染、错误不带 message 时仍展示通用标题

Test plan

  • pnpm exec tsc --noEmit
  • pnpm lint
  • pnpm test:run tests/components/cliproxy-instance-logs-panel.test.tsx(8 通过)
  • CI 全绿

接 PR #200:管理 API 客户端已把上游 400 错误正文拼到 message 上,
但前端日志面板仍只展示 logsLoadFailed 通用文案,把根因吞掉。

现在 panel 在 isError 时额外展示 error.message —— 例如 CLIProxyAPI 端
未启用 LoggingToFile 时,用户能直接看到 "logging to file disabled",
不再需要去后端日志里翻栈才知道为什么 502。
@codecov

codecov Bot commented May 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.44%. Comparing base (de6385b) to head (414d62e).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #201      +/-   ##
==========================================
- Coverage   74.44%   74.44%   -0.01%     
==========================================
  Files         160      160              
  Lines       11624    11626       +2     
  Branches     3980     3982       +2     
==========================================
+ Hits         8654     8655       +1     
  Misses       1731     1731              
- Partials     1239     1240       +1     
Flag Coverage Δ
verify 74.44% <100.00%> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@g1331 g1331 merged commit bee51e7 into master May 31, 2026
12 checks passed
@g1331 g1331 deleted the hotfix/cliproxy-logs-error-detail branch May 31, 2026 12:47
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