1#[derive(Debug, thiserror::Error)]
2pub enum HostError {
3 #[error("io error: {0}")]
4 Io(#[from] std::io::Error),
5 #[error("codec error: {0}")]
6 Codec(airbender_codec::CodecError),
7 #[error("wire error: {0}")]
8 Wire(airbender_core::wire::WireError),
9 #[error("invalid manifest: {0}")]
10 InvalidManifest(String),
11 #[error("transpiler error: {0}")]
12 Transpiler(String),
13 #[error("runner error: {0}")]
14 Runner(String),
15 #[error("prover error: {0}")]
16 Prover(String),
17 #[error("verification error: {0}")]
18 Verification(String),
19}
20
21pub type Result<T> = std::result::Result<T, HostError>;
22
23impl From<airbender_codec::CodecError> for HostError {
24 fn from(err: airbender_codec::CodecError) -> Self {
25 Self::Codec(err)
26 }
27}
28
29impl From<airbender_core::wire::WireError> for HostError {
30 fn from(err: airbender_core::wire::WireError) -> Self {
31 Self::Wire(err)
32 }
33}