1use thiserror::Error;
2use tonic::Status;
3
4#[derive(Error, Debug)]
6pub enum Error {
7 #[error("Program simulation failed")]
9 SimulationFailed,
10
11 #[error("Proof request 0x{} is unexecutable", hex::encode(.request_id))]
13 RequestUnexecutable {
14 request_id: Vec<u8>,
16 },
17
18 #[error("Proof request 0x{} is unfulfillable", hex::encode(.request_id))]
20 RequestUnfulfillable {
21 request_id: Vec<u8>,
23 },
24
25 #[error("Proof request 0x{} timed out", hex::encode(.request_id))]
27 RequestTimedOut {
28 request_id: Vec<u8>,
30 },
31
32 #[error("Proof request 0x{} timed out during the auction", hex::encode(.request_id))]
34 RequestAuctionTimedOut {
35 request_id: Vec<u8>,
37 },
38
39 #[error("RPC error: {0}")]
41 RpcError(#[from] Status),
42
43 #[error("Other error: {0}")]
45 Other(#[from] anyhow::Error),
46}