iskra 0.2.1

A safe, modern, Rust-native data transfer tool.
Documentation
//! Error types for Iskra

use thiserror::Error;
use std::io;

#[derive(Error, Debug)]
pub enum IskraError {
    /// HTTP client error (network, protocol, etc.)
    #[error("HTTP error: {source} (url: {url})")]
    Http {
        source: reqwest::Error,
        url: String,
    },
    /// HTTP status error (non-success)
    #[error("HTTP status error: {status} (url: {url})")]
    Status {
        status: u16,
        url: String,
    },
    /// IO error (filesystem, etc.)
    #[error("IO error: {source} (path: {path})")]
    Io {
        source: io::Error,
        path: String,
    },
    /// Cache error (corrupt, IO, etc.)
    #[error("Cache error: {msg} (key: {key})")]
    Cache {
        msg: String,
        key: String,
    },
    /// Configuration or argument error
    #[error("Config error: {msg}")]
    Config {
        msg: String,
    },
    /// Timeout error
    #[error("Timeout error: {operation} (timeout: {timeout_secs}s)")]
    Timeout {
        operation: String,
        timeout_secs: u64,
    },
    /// Any other error
    #[error("Other error: {0}")]
    Other(String),
}