src/errors.rs

polyfill-rs · src/errors.rs · rust · Apache-2.0
auth

! Error types for the Polymarket client ! ! This module defines all error types used throughout the client, designed ! for clear error handling in trading environments where fast error recovery ! is critical.

// Source: https://github.com/jtranq/polyfill-rs | License: Apache-2.0 | Copyright 2025-2026 Julius Tranquilli and contributors
// Provided via justclaw.it.com; keep this notice with the code.
//! Error types for the Polymarket client
//!
//! This module defines all error types used throughout the client, designed
//! for clear error handling in trading environments where fast error recovery
//! is critical.

use std::time::Duration;
use thiserror::Error;

/// Main error type for the Polymarket client
#[derive(Error, Debug)]
pub enum PolyfillError {
    /// Network-related errors (retryable)
    #[error("Network error: {message}")]
    Network {
        message: String,
        #[source]
        source: Option<Box<dyn std::error::Error + Send + Sync>>,
    },

    /// API errors from Polym

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

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

Get a free API key