use crate::config::error::ConfigError;
use crate::storage::error::StorageError;
use thiserror::Error;
pub type Result<T, E = CoreError> = std::result::Result<T, E>;
#[derive(Error, Debug)]
pub enum CoreError {
#[error(transparent)]
ArrowError(#[from] arrow::error::ArrowError),
#[error("Config error: {0}")]
Config(#[from] ConfigError),
#[error("Commit metadata error: {0}")]
CommitMetadata(String),
#[error("{0}")]
MergeRecordError(String),
#[error("Data type error: {0}")]
Schema(String),
#[error("File group error: {0}")]
FileGroup(String),
#[error("{0}")]
ReadFileSliceError(String),
#[error("{0}")]
LogFormatError(String),
#[error("{0}")]
LogBlockError(String),
#[error("{0}")]
InvalidPartitionPath(String),
#[error("{0}")]
InvalidValue(String),
#[error(transparent)]
ParquetError(#[from] parquet::errors::ParquetError),
#[error("{0}")]
ReadLogFileError(#[from] std::io::Error),
#[error("Storage error: {0}")]
Storage(#[from] StorageError),
#[error("Timeline error: {0}")]
Timeline(String),
#[error("{0}")]
Unsupported(String),
#[error(transparent)]
Utf8Error(#[from] std::str::Utf8Error),
}