|
|
|
@ -12,7 +12,9 @@ pub enum Error {
|
|
|
|
|
NotFound(PathBuf),
|
|
|
|
|
InvalidUtf8,
|
|
|
|
|
TypeError{expected:LispType, got: LispType},
|
|
|
|
|
BadLength,
|
|
|
|
|
UnexpectedEmpty,
|
|
|
|
|
UnknownDefinition(String),
|
|
|
|
|
|
|
|
|
|
Unknown,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -52,7 +54,9 @@ impl std::fmt::Display for Error
|
|
|
|
|
Self::NotFound(path) => write!(f, "File not found: {:?}", path),
|
|
|
|
|
Self::InvalidUtf8 => write!(f, "Invalid UTF8 decoded string or some such"),
|
|
|
|
|
Self::TypeError{expected, got} => write!(f, "Type mismatch: Expected {}, got {}", expected, got),
|
|
|
|
|
Self::BadLength => write!(f, "expected at least 1 element"),
|
|
|
|
|
Self::UnexpectedEmpty => write!(f, "expected a non-empty list"),
|
|
|
|
|
Self::UnknownDefinition(def) => write!(f, "unknown definition `{}'", def),
|
|
|
|
|
|
|
|
|
|
_ => write!(f, "unknown error")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|