Roo-Code/src/api/providers/utils
Roo Code e91bb8593d feat: improve HTTP 402 error handling for all providers
Fixes issue where providers like DeepSeek show "Unknown API error"
instead of user-friendly messages for HTTP status codes like 402
(insufficient balance/payment required).

Changes:
- Modify handleProviderError to prefix error messages with HTTP status
  code (e.g., "402 - DeepSeek completion error: ...") when status >= 400
- This allows the UI (ChatRow.tsx) to parse the status code and display
  appropriate user-friendly messages from the localization files
- Preserves existing behavior for custom messageTransformers and
  non-HTTP errors

The UI already has localized messages for common HTTP status codes
(400, 401, 402, 403, 429, 500) but they were not being shown because
the error message format did not allow the UI to extract the status code.

Closes #10016
2026-01-07 21:00:20 +00:00
..
__tests__ feat: improve HTTP 402 error handling for all providers 2026-01-07 21:00:20 +00:00
error-handler.ts feat: improve HTTP 402 error handling for all providers 2026-01-07 21:00:20 +00:00
image-generation.ts Add support for images api (#9587) 2025-11-25 14:18:14 -05:00
openai-error-handler.ts ux: improve API error handling and visibility (#10204) 2025-12-19 11:38:56 -08:00
router-tool-preferences.ts feat: Replace edit_file tool alias with edit_file tool (#9983) 2025-12-18 12:48:30 -07:00
timeout-config.ts fix: return undefined instead of 0 for disabled API timeout (#9960) 2025-12-09 15:32:26 -07:00