use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("{0} doesn't have the right format")]
InvalidFormat(String),
#[error("Value {0} doesn't have the {1} type.")]
Type(String, String),
#[error("Column {0} not in schema {1}.")]
ColumnNotInSchema(String, String),
#[error("Failed to convert {0} to {1}.")]
Conversion(String, String),
#[error("{0} not found.")]
NotFound(String),
#[error("Feature {0} is not supported.")]
NotSupported(String),
#[error(transparent)]
Avro(#[from] apache_avro::Error),
#[error(transparent)]
JSONSerde(#[from] serde_json::Error),
#[error(transparent)]
Chrono(#[from] chrono::ParseError),
#[error(transparent)]
Uuid(#[from] uuid::Error),
#[error(transparent)]
IO(#[from] std::io::Error),
#[error(transparent)]
TryFromSlice(#[from] std::array::TryFromSliceError),
#[error(transparent)]
TryFromInt(#[from] std::num::TryFromIntError),
#[error(transparent)]
UTF8(#[from] std::str::Utf8Error),
#[error(transparent)]
FromUTF8(#[from] std::string::FromUtf8Error),
#[error(transparent)]
ParseInt(#[from] std::num::ParseIntError),
#[error(transparent)]
TableMetadataBuilder(#[from] crate::spec::table_metadata::TableMetadataBuilderError),
#[error(transparent)]
ViewMetadataBuilder(#[from] crate::spec::view_metadata::GeneralViewMetadataBuilderError),
#[error(transparent)]
VersionBuilder(#[from] crate::spec::view_metadata::VersionBuilderError),
#[error(transparent)]
ManifestEntryBuilder(#[from] crate::spec::manifest::ManifestEntryBuilderError),
#[error(transparent)]
DatafileBuilder(#[from] crate::spec::manifest::DataFileBuilderError),
#[error(transparent)]
SnapshotBuilder(#[from] crate::spec::snapshot::SnapshotBuilderError),
#[error(transparent)]
StructTypeBuilder(#[from] crate::spec::types::StructTypeBuilderError),
#[error(transparent)]
PartitionSpec(#[from] crate::spec::partition::PartitionSpecBuilderError),
}