Skip to content

feat(webui): name 5xx failures as server errors - #986

Merged
alcholiclg merged 2 commits into
modelscope:mainfrom
Col0ring:feat/server-error-message
Sep 18, 2026
Merged

alcholiclg merged 2 commits into
modelscope:mainfrom
Col0ring:feat/server-error-message

Conversation

@Col0ring

@Col0ring Col0ring commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add an errors.server message ("Server error — please try again later" / "服务器出错了,请稍后重试")
  • extract the failure-to-text logic into a shared describeFailure helper in the api layer: the backend's own message when it sent one, otherwise the HTTP status first (502 Bad Gateway) and a server-vs-client headline second, with 5xx named a server error instead of "request failed" or the network hint
  • reuse the helper in the REST toast bridge, the error boundary and the chat path so a failure reads identically everywhere
  • throw an ApiError from the chat-stream guard so a failed turn carries the status and any backend message, and describe failed chat turns through the same helper

Test

  • pnpm typecheck

- add an `errors.server` message and use it for 5xx responses in the toast
  bridge and the error boundary, instead of "request failed" or the network
  hint which misattribute a server-side fault
- format the toast as `status: headline` so the code leads and the phrase says
  whose fault it is
- extract the failure-to-text logic into `describeFailure` in the api layer and
  call it from the toast bridge instead of inlining it
- throw an `ApiError` from the chat-stream guard so a failed turn carries the
  status and any backend message
- describe failed chat turns through the same helper so they read like a failed
  REST call
@alcholiclg
alcholiclg merged commit 90898f9 into modelscope:main Sep 18, 2026
1 of 2 checks passed
@Col0ring
Col0ring deleted the feat/server-error-message branch September 18, 2026 09:50
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.

2 participants