(status_code: int, content: bytes)
| 4963 | return _spend_error(check, api_format=api_format, headers=debug_headers) |
| 4964 | |
| 4965 | def _should_try_fallback(status_code: int, content: bytes) -> bool: |
| 4966 | if not is_virtual or not fallback_models: |
| 4967 | return False |
| 4968 | if status_code in (500, 502, 503, 504): |
| 4969 | return True |
| 4970 | return status_code in (400, 404, 422) and _is_model_error(content) |
| 4971 | |
| 4972 | def _transport_error_response(exc: httpx.TransportError) -> httpx.Response: |
| 4973 | status_code = 504 if isinstance(exc, httpx.TimeoutException) else 502 |
no test coverage detected