use gitdag::dag::Vertex;
use std::convert::Infallible;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error(transparent)]
Dag(#[from] gitdag::dag::Error),
#[error(transparent)]
Git2(#[from] gitdag::git2::Error),
#[error("ambiguous prefix: {0:?}")]
AmbiguousPrefix(Vec<Vertex>),
#[error("name {0:?} cannot be resolved")]
UnresolvedName(String),
#[error("function {0} requires {1} arguments, but got {2} arguments")]
MismatchedArguments(String, usize, usize),
#[error("expect string, got {0}")]
ExpectString(String),
#[error("{0}")]
ParseError(String),
}
impl From<Infallible> for Error {
fn from(_e: Infallible) -> Self {
unreachable!()
}
}