#[non_exhaustive]pub enum ProviderError {
Show 15 variants
OpenAI(OpenAIError),
Anthropic(AnthropicError),
Gemini(GeminiError),
Azure(AzureOpenAIError),
Cohere(CohereError),
Ollama(OllamaError),
Assistant(AssistantError),
Responses(ResponsesError),
DeepSeek(OpenAIError),
Qwen(OpenAIError),
Moonshot(OpenAIError),
Zhipu(OpenAIError),
Mistral(OpenAIError),
Config(String),
Testkit(String),
}Expand description
Unified error type that aggregates all LLM provider errors.
This allows using ? across provider boundaries without manually
mapping error types. Each variant wraps the original provider
error, preserving full context.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
OpenAI(OpenAIError)
OpenAI API error.
Anthropic(AnthropicError)
Anthropic API error.
Gemini(GeminiError)
Gemini API error.
Azure(AzureOpenAIError)
Azure OpenAI API error.
Cohere(CohereError)
Cohere API error.
Ollama(OllamaError)
Ollama API error.
Assistant(AssistantError)
OpenAI Assistants API error.
Responses(ResponsesError)
OpenAI Responses API error.
DeepSeek(OpenAIError)
DeepSeek API error (OpenAI-compatible endpoint).
Qwen(OpenAIError)
Qwen (Alibaba) API error (OpenAI-compatible endpoint).
Moonshot(OpenAIError)
Moonshot (Kimi) API error (OpenAI-compatible endpoint).
Zhipu(OpenAIError)
Zhipu (ChatGLM) API error (OpenAI-compatible endpoint).
Mistral(OpenAIError)
Mistral API error (OpenAI-compatible endpoint).
Config(String)
Configuration error (missing/malformed environment variables, etc.).
Testkit(String)
Testkit harness error (recording/replay failures from lc-testkit).
Trait Implementations§
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<AnthropicError> for ProviderError
impl From<AnthropicError> for ProviderError
Source§fn from(e: AnthropicError) -> Self
fn from(e: AnthropicError) -> Self
Source§impl From<AssistantError> for ProviderError
impl From<AssistantError> for ProviderError
Source§fn from(e: AssistantError) -> Self
fn from(e: AssistantError) -> Self
Source§impl From<AzureOpenAIError> for ProviderError
impl From<AzureOpenAIError> for ProviderError
Source§fn from(e: AzureOpenAIError) -> Self
fn from(e: AzureOpenAIError) -> Self
Source§impl From<CohereError> for ProviderError
impl From<CohereError> for ProviderError
Source§fn from(e: CohereError) -> Self
fn from(e: CohereError) -> Self
Source§impl From<GeminiError> for ProviderError
impl From<GeminiError> for ProviderError
Source§fn from(e: GeminiError) -> Self
fn from(e: GeminiError) -> Self
Source§impl From<OllamaError> for ProviderError
impl From<OllamaError> for ProviderError
Source§fn from(e: OllamaError) -> Self
fn from(e: OllamaError) -> Self
Source§impl From<OpenAIError> for ProviderError
impl From<OpenAIError> for ProviderError
Source§fn from(e: OpenAIError) -> Self
fn from(e: OpenAIError) -> Self
Source§impl From<ProviderError> for LcelError
Allow ProviderError to convert into LcelError for LCEL pipeline compatibility.
This enables LLM providers to participate in pipe() chains.
impl From<ProviderError> for LcelError
Allow ProviderError to convert into LcelError for LCEL pipeline compatibility.
This enables LLM providers to participate in pipe() chains.
Source§fn from(err: ProviderError) -> Self
fn from(err: ProviderError) -> Self
Source§impl From<ProviderError> for OpenAIError
impl From<ProviderError> for OpenAIError
Source§fn from(e: ProviderError) -> Self
fn from(e: ProviderError) -> Self
Source§impl From<ResponsesError> for ProviderError
impl From<ResponsesError> for ProviderError
Source§fn from(e: ResponsesError) -> Self
fn from(e: ResponsesError) -> Self
Source§impl From<String> for ProviderError
Allow testkit harness errors (recording/replay) to surface through the
provider error chain. lc-testkit is an external crate and cannot
construct #[non_exhaustive] variants, so this is the sole entry point.
impl From<String> for ProviderError
Allow testkit harness errors (recording/replay) to surface through the
provider error chain. lc-testkit is an external crate and cannot
construct #[non_exhaustive] variants, so this is the sole entry point.