coder999o opened a new pull request, #1967:
URL: https://github.com/apache/rocketmq-dashboard/pull/1967
## What is the purpose of the change
Preserve backend error messages from failed AI chat HTTP responses before
the SSE stream is opened.
The AI chat API uses `fetch` directly, so it does not use the shared axios
response interceptor. When the backend returns a standard error payload such as
`{ code, message, data }`, the UI previously replaced the real message with a
generic `AI chat failed: Bad Request`.
## Brief changelog
- Parse failed AI chat HTTP response bodies before falling back to
`statusText`.
- Throw `AiStreamError` with the backend message and HTTP status.
- Add regression coverage for standard backend error payloads.
## Verifying this change
- `git diff --check`
- `npm test -- --run src/api/ai.test.ts`
- `./node_modules/.bin/eslint --max-warnings=0 src/api/ai.ts
src/api/ai.test.ts`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]