scirs2_datasets/
error.rs

1//! Error types for the datasets module
2
3use std::io;
4use thiserror::Error;
5
6/// Error type for datasets operations
7#[derive(Error, Debug)]
8pub enum DatasetsError {
9    /// Invalid data format
10    #[error("Invalid format: {0}")]
11    InvalidFormat(String),
12
13    /// Data loading error
14    #[error("Loading error: {0}")]
15    LoadingError(String),
16
17    /// Download error
18    #[error("Download error: {0}")]
19    DownloadError(String),
20
21    /// Cache error
22    #[error("Cache error: {0}")]
23    CacheError(String),
24
25    /// IO error
26    #[error("IO error: {0}")]
27    IoError(#[from] io::Error),
28
29    /// Serialization/Deserialization error
30    #[error("Serialization error: {0}")]
31    SerdeError(String),
32
33    /// Other error
34    #[error("Error: {0}")]
35    Other(String),
36}
37
38/// Result type for datasets operations
39pub type Result<T> = std::result::Result<T, DatasetsError>;