Non Retryable Provider Error (src/traits.rs)

zeroclaw · crates/zeroclaw-providers/src/traits.rs · rust · Apache-2.0
ai, integration, lang:rust, tag:error-handling, tag:retry

Rust error type marking AI or API provider failures as definitively non-retryable. Use to decouple retry policies from provider-specific error messages.

// Source: https://github.com/zeroclaw-labs/zeroclaw | License: Apache-2.0 | Copyright 2025 ZeroClaw Labs
// Provided via justclaw.it.com; keep this notice with the code.
pub use zeroclaw_api::model_provider::*;

/// Marks a provider failure as definitively non-retryable without coupling
/// shared retry policy to provider-specific error text.
#[derive(Debug)]
pub struct NonRetryableProviderError {
    message: String,
    source: Option<Box<dyn std::error::Error + Send + Sync>>,
}

impl NonRetryableProviderError {
    #[must_use]
    pub fn new(message: impl Into<String>) -> Self {
        Self {
            message: message.into(),
            source: None,
        }
    }

    #[must_use]
    pub fn with_source(
        message: impl Into<String>,
        source: impl std::error::Error 

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key