use thiserror::Error;
#[derive(Debug, Error)]
pub enum DataLoadError {
#[error("invalid UTF-8 in file content: {0}")]
Utf8(#[from] std::str::Utf8Error),
#[error("polars error: {0}")]
Polars(#[from] polars::prelude::PolarsError),
#[cfg(feature = "excel")]
#[error("excel parsing error: {0}")]
Excel(#[from] calamine::Error),
#[error("unsupported file type: {0}")]
UnsupportedFileType(String),
#[error("no sheets found in excel file")]
NoSheetsFound,
#[error("file is empty or contains no data")]
EmptyFile,
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("could not detect a valid delimiter in CSV file")]
DelimiterDetectionFailed,
}
pub type Result<T> = std::result::Result<T, DataLoadError>;