2020-10-13 14:07:22 -07:00
|
|
|
use crate::obj::prelude::*;
|
2020-09-14 16:32:00 -07:00
|
|
|
use snafu::Snafu;
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Snafu)]
|
|
|
|
|
pub enum Error {
|
2020-10-13 14:07:22 -07:00
|
|
|
#[snafu(display("missing attribute: {}", global_sym_lookup(*attr).unwrap()))]
|
|
|
|
|
MissingAttr {
|
|
|
|
|
attr: Sym,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
#[snafu(display("{}", error))]
|
|
|
|
|
ValueError {
|
|
|
|
|
error: String,
|
|
|
|
|
value: ObjRef,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
#[snafu(display("incorrect function arity; expected {} but got {} instead", expected, got))]
|
|
|
|
|
ArityError {
|
|
|
|
|
expected: usize,
|
|
|
|
|
got: usize,
|
|
|
|
|
},
|
2020-09-14 16:32:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub type Result<T, E = Error> = std::result::Result<T, E>;
|