heisenberg_data_processing/
error.rs

1use polars::prelude::PolarsError;
2use thiserror::Error;
3pub type Result<T> = std::result::Result<T, DataError>;
4
5#[derive(Error, Debug)]
6pub enum DataError {
7    #[error("IO error: {0}")]
8    Io(#[from] std::io::Error),
9    #[error("Polars error: {0}")]
10    Polars(#[from] PolarsError),
11    #[cfg(feature = "download-data")]
12    #[error("HTTP error: {0}")]
13    Http(#[from] reqwest::Error),
14    #[cfg(feature = "download-data")]
15    #[error("Join error: {0}")]
16    JoinError(#[from] tokio::task::JoinError),
17    #[cfg(feature = "download-data")]
18    #[error("Zip error: {0}")]
19    ZipError(#[from] zip::result::ZipError),
20    #[error("Serialization error: {0}")]
21    Serde(#[from] serde_json::Error),
22    #[error("No data directory provided and download_data feature is disabled")]
23    NoDataDirProvided,
24    #[error("Required data files not found in the provided directory")]
25    RequiredFilesNotFound,
26    #[error("Metadata file not found in the provided directory")]
27    MetadataFileNotFound,
28    #[error("Embedded Admin data not found in the provided directory")]
29    EmbeddedAdminDataNotFound,
30    #[error("Embedded data not found in the provided directory")]
31    EmbeddedDataNotFound,
32}