Skip to main content

classify_error_from_response

Function classify_error_from_response 

Source
pub fn classify_error_from_response(
    http_status: u16,
    response_body: Option<&Value>,
) -> StandardErrorCode
Expand description

Classify an error from HTTP status and optional response body.

Provider-specific error codes in the response body (e.g., OpenAI context_length_exceeded, Anthropic overloaded_error) override the HTTP status mapping when available.