15 lines
327 B
Rust
15 lines
327 B
Rust
/// Error type for data fetching operations.
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum DataError {
|
|
#[error("HTTP error: {0}")]
|
|
Http(#[from] reqwest::Error),
|
|
|
|
#[error("JSON error: {0}")]
|
|
Json(#[from] serde_json::Error),
|
|
|
|
#[error("{0}")]
|
|
Other(String),
|
|
}
|
|
|
|
pub type DataResult<T> = Result<T, DataError>;
|