You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Improve exception handling and response parsing
Refined error handling in `DefaultResponseProcess` (net.ts):
- For non-OK HTTP responses:
- Robustly extracts error messages by attempting to parse the
response body first as JSON, then as text, using `response.clone()`
before each attempt to prevent stream consumption issues.
- Logs intermediate parsing failures to `console.debug`.
- Throws a more informative error message.
- For OK HTTP responses:
- When falling back to text after a `response.json()` failure,
enhanced `console.debug` logging and comments to clarify
that this is intentional content negotiation.
These changes aim to satisfy static analysis tools regarding
unhandled exceptions by making error handling more explicit,
logging relevant information, and clarifying intent in catch blocks.
0 commit comments