Skip to main content

humanize_api_error

Function humanize_api_error 

Source
pub fn humanize_api_error(status: u16, body: &str) -> String
Expand description

Translate an Anthropic API error response into a human-actionable message.

Parses the error body ({"error": {"type": ..., "message": ...}}) and maps well-known statuses to guidance. Falls back to a trimmed version of the raw body for unknown cases.