Skip to main content

classify_api_error

Function classify_api_error 

Source
pub fn classify_api_error(
    error_message: &str,
    status_code: Option<u16>,
    provider: Option<&str>,
) -> StructuredError
Expand description

Classify an API error into a structured error type.

Checks the raw error message against known patterns for context overflow, rate limiting, authentication failures, and gateway/proxy issues across all supported providers (Anthropic, OpenAI, Google, Azure).