use thiserror::Error;
pub type Result<T, E = StorageError> = std::result::Result<T, E>;
#[derive(Error, Debug)]
pub enum StorageError {
#[error(transparent)]
ArrowError(#[from] arrow::error::ArrowError),
#[error("Failed to create storage: {0}")]
Creation(String),
#[error("Invalid path: {0}")]
InvalidPath(String),
#[error("Invalid column: {0}")]
InvalidColumn(String),
#[error("Unsupported base file format: {0}")]
UnsupportedBaseFileFormat(String),
#[error(transparent)]
ObjectStoreError(#[from] object_store::Error),
#[error(transparent)]
ObjectStorePathError(#[from] object_store::path::Error),
#[error(transparent)]
ReaderError(#[from] std::io::Error),
#[error(transparent)]
ParquetError(#[from] parquet::errors::ParquetError),
#[error(transparent)]
LanceError(#[from] lance_core::Error),
#[error(transparent)]
UrlParseError(#[from] url::ParseError),
}