use thiserror::Error;
use std::io;
#[derive(Error, Debug)]
pub enum IskraError {
#[error("HTTP error: {source} (url: {url})")]
Http {
source: reqwest::Error,
url: String,
},
#[error("HTTP status error: {status} (url: {url})")]
Status {
status: u16,
url: String,
},
#[error("IO error: {source} (path: {path})")]
Io {
source: io::Error,
path: String,
},
#[error("Cache error: {msg} (key: {key})")]
Cache {
msg: String,
key: String,
},
#[error("Config error: {msg}")]
Config {
msg: String,
},
#[error("Timeout error: {operation} (timeout: {timeout_secs}s)")]
Timeout {
operation: String,
timeout_secs: u64,
},
#[error("Other error: {0}")]
Other(String),
}