Skip to main content

moonproof_runtime_ir/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum IrError {
5    #[error("I/O error reading IR: {0}")]
6    Io(#[from] std::io::Error),
7
8    #[error("CBOR parse error: {0}")]
9    Cbor(String),
10
11    #[error("unsupported schema-version {actual}; this consumer supports {supported}")]
12    UnsupportedSchemaVersion { actual: u32, supported: u32 },
13
14    #[error("invalid descriptor reference '{0}'")]
15    InvalidDescriptor(String),
16
17    #[error("hex decode error: {0}")]
18    Hex(#[from] hex::FromHexError),
19}
20
21pub type Result<T> = std::result::Result<T, IrError>;