cherry-studio/src/main/knowledge
Zhaokun bf35228b49
fix: capture detailed error response body for reranker API failures (#10839)
* fix: capture detailed error response body for reranker API failures

Previously, when reranker API returned 400 or other error status codes,
only the HTTP status and status text were captured, without reading the
actual error response body that contains detailed error information.

This commit fixes the issue by:
- Reading the error response body (as JSON or text) before throwing error
- Attaching the response details to the error object
- Including responseBody in formatErrorMessage output

This will help diagnose issues like "qwen3-reranker not available" by
showing the actual error message from the API provider.

* fix: enhance error handling in GeneralReranker for API failures

This update improves the error handling in the GeneralReranker class by ensuring that the response body is properly cloned and read when an API call fails. The detailed error information, including the status, status text, and body, is now attached to the error object. This change aids in diagnosing issues by providing more context in error messages.
2025-10-21 10:36:53 +08:00
..
embedjs feat: use oxlint to speed up lint (#10168) 2025-09-15 19:42:13 +08:00
preprocess feat: refactor Knowledge Base (#8384) 2025-09-04 17:23:31 +08:00
reranker fix: capture detailed error response body for reranker API failures (#10839) 2025-10-21 10:36:53 +08:00