Expand description
Centralized error handling for LLM providers Eliminates duplicate error handling code across providers
Constants§
- STATUS_
BAD_ REQUEST - STATUS_
FORBIDDEN - STATUS_
TOO_ MANY_ REQUESTS - STATUS_
UNAUTHORIZED - HTTP status codes for common error types
Functions§
- extract_
human_ error_ message - Extract the most human-readable error message from a provider’s JSON error body.
- format_
http_ error - Format HTTP error with status code and message
- format_
network_ error - Handle network errors with consistent formatting
- format_
parse_ error - Handle JSON parsing errors with consistent formatting
- handle_
anthropic_ http_ error - Handle HTTP response errors for Anthropic provider
- handle_
gemini_ http_ error - Handle HTTP response errors for Gemini provider
- handle_
openai_ http_ error - Handle HTTP response errors for OpenAI-compatible providers
- is_
rate_ limit_ error - Check if an error is a rate limit error based on status code and message
- parse_
api_ error - Parse standard API error response body into LLMError.