Repository navigation
v0.14.2
Bug Fixes
- provider: Add HTTP status code validation for non-JSON error responses
Details
Improved error handling in the OpenAI provider to properly detect and handle non-JSON HTTP error responses (e.g., HTML error pages from proxies, Cloudflare errors). The fix checks if non-2xx responses contain JSON before passing to error parsers.
- Preserve existing behavior for JSON error responses from OpenAI API
- Return immediate error with status code for HTML/text error responses
- Add test case for non-JSON error handling (502 Bad Gateway)
This prevents cryptic parsing errors when encountering proxy or gateway errors.
Full Changelog: v0.14.1...v0.14.2