pub fn classify_mistral_error(
status: u16,
message: impl Into<String>,
retry_after: Option<f64>,
) -> ErrorExpand description
Classify a non-success Mistral Chat Completions API HTTP response into a
granular Error.
Mistral’s documented error body is {"object":"error","message":..., "type":...,"param":...,"code":...} (OpenAI-shaped but without a nested
error wrapper). This maps by HTTP status only:
401/403->Error::ServiceInvalidAuth400/422->Error::ServiceInvalidRequest- anything else — notably
408/429/5xx, which the retry layer depends on — ->Error::ServiceStatus, unchanged
Unlike OpenAI, Mistral has no documented content-filter-specific error
marker to key off of (no code: "content_filter" convention), so this
never constructs Error::ServiceContentFilter – don’t invent one.