use thiserror::Error;
#[derive(Debug, Error)]
pub enum ElError {
#[error("source error: {0}")]
Source(String),
#[error("destination error: {0}")]
Destination(String),
#[error("io error: {0}")]
Io(#[from] std::io::Error),
#[error("arrow error: {0}")]
Arrow(#[from] arrow::error::ArrowError),
#[error("{0}")]
Other(String),
}
impl ElError {
pub fn source<S: Into<String>>(msg: S) -> Self {
Self::Source(msg.into())
}
pub fn destination<S: Into<String>>(msg: S) -> Self {
Self::Destination(msg.into())
}
pub fn other<S: Into<String>>(msg: S) -> Self {
Self::Other(msg.into())
}
}