tvl-depot/tvix/eval/src/errors.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
576 B
Rust
Raw Normal View History

use std::fmt::Display;
#[derive(Debug)]
pub enum Error {
DuplicateAttrsKey {
key: String,
},
InvalidKeyType {
given: &'static str,
},
AttributeNotFound {
name: String,
},
TypeError {
expected: &'static str,
actual: &'static str,
},
Incomparable {
lhs: &'static str,
rhs: &'static str,
},
}
impl Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
writeln!(f, "{:?}", self)
}
}
pub type EvalResult<T> = Result<T, Error>;