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}.")]
Schema(String, String),
#[error("Failed to convert {0} to {1}.")]
Conversion(String, String),
#[error("{0} {1} not found.")]
NotFound(String, String),
#[error("Feature {0} is not supported.")]
NotSupported(String),
#[error("avro error")]
Avro(#[from] apache_avro::Error),
#[error("serde json error")]
JSONSerde(#[from] serde_json::Error),
#[error("chrono parse error")]
Chrono(#[from] chrono::ParseError),
#[error("uuid error")]
Uuid(#[from] uuid::Error),
#[error("io error")]
IO(#[from] std::io::Error),
#[error("object store error")]
ObjectStore(#[from] object_store::Error),
#[error("try from slice error")]
TryFromSlice(#[from] std::array::TryFromSliceError),
#[error("try from int error")]
TryFromInt(#[from] std::num::TryFromIntError),
#[error("utf8 error")]
UTF8(#[from] std::str::Utf8Error),
#[error("from utf8 error")]
FromUTF8(#[from] std::string::FromUtf8Error),
#[error("parse int error")]
ParseInt(#[from] std::num::ParseIntError),
#[error("table metadata builder")]
TableMetadataBuilder(#[from] crate::spec::table_metadata::TableMetadataBuilderError),
#[error("view metadata builder")]
ViewMetadataBuilder(#[from] crate::spec::view_metadata::GeneralViewMetadataBuilderError),
#[error("version builder")]
VersionBuilder(#[from] crate::spec::view_metadata::VersionBuilderError),
}