Skip to main content

libid_contracts/
error.rs

1/// Crate error type.
2#[derive(Debug, thiserror::Error)]
3pub enum Error {
4    /// A vendored artifact is missing, unparsable, or malformed.
5    #[error("artifact error: {detail}")]
6    Artifact {
7        /// What went wrong.
8        detail: String,
9    },
10    /// An RPC send, receipt wait, or read failed.
11    #[error("rpc error: {detail}")]
12    Rpc {
13        /// What went wrong.
14        detail: String,
15    },
16    /// A Platform Verifier initializer the contract would refuse, caught
17    /// before any transaction is sent.
18    #[error("initializer error: {detail}")]
19    Initializer {
20        /// Which rule, and which contract.
21        detail: String,
22    },
23}
24
25/// Crate result alias.
26pub type Result<T> = std::result::Result<T, Error>;