use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("invalid type for {0}: {1}")]
InvalidType(String, String),
#[error("invalid integer value for {0}: {1}")]
InvalidInt(String, #[source] std::num::ParseIntError),
#[error("invalid float value for {0}: {1}")]
InvalidFloat(String, #[source] std::num::ParseFloatError),
#[error("no null value defined")]
NoNullValue,
#[error("invalid UTF-8 in string: {0}")]
InvalidUtf8(#[from] std::string::FromUtf8Error),
#[error("cannot deserialize \"Unknown\" type")]
UnknownType,
#[error("unsupported value: {0}")]
UnsupportedValue(serde_json::Value),
#[error("header missing in TSV file")]
HeaderMissing,
#[error("I/O error: {0}")]
Io(#[source] std::io::Error),
#[error("mismatching number of columns: {0} != {1}")]
ColumnCount(usize, usize),
#[error("mismatching of null values: {0} != {1}")]
NullValues(String, String),
#[error("mismatching number of column names: {0} != {1}")]
ColumnName(String, String),
#[error("problem opening RocksDB at {0}: {1}")]
RocksDBOpen(PathBuf, #[source] rocksdb::Error),
#[error("problem accessing RocksDB property: {0}")]
RocksDBProperty(#[source] rocksdb::Error),
#[error("other error")]
OtherError,
}