Skip to main content

sui_spec/
error.rs

1//! Errors produced while loading or interpreting sui-spec specs.
2
3use thiserror::Error;
4
5#[derive(Error, Debug)]
6pub enum SpecError {
7    #[error("spec load error: {0}")]
8    Load(String),
9
10    #[error("spec compile error: {0}")]
11    Compile(String),
12
13    #[error("interpreter error in {phase}: {message}")]
14    Interp { phase: String, message: String },
15
16    #[error("unbound slot {0} — earlier phase never wrote to it")]
17    UnboundSlot(String),
18}
19
20impl From<tatara_lisp::LispError> for SpecError {
21    fn from(err: tatara_lisp::LispError) -> Self {
22        SpecError::Compile(err.to_string())
23    }
24}