-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
348 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
use thiserror::Error; | ||
use tonic::Status; | ||
|
||
/// An error that can occur when interacting with the prover network. | ||
#[derive(Error, Debug)] | ||
pub enum Error { | ||
/// The program execution failed. | ||
#[error("Program simulation failed")] | ||
SimulationFailed, | ||
|
||
/// The proof request is unexecutable. | ||
#[error("Proof request 0x{} is unexecutable", hex::encode(.request_id))] | ||
RequestUnexecutable { | ||
/// The ID of the request that cannot be executed. | ||
request_id: Vec<u8>, | ||
}, | ||
|
||
/// The proof request is unfulfillable. | ||
#[error("Proof request 0x{} is unfulfillable", hex::encode(.request_id))] | ||
RequestUnfulfillable { | ||
/// The ID of the request that cannot be fulfilled. | ||
request_id: Vec<u8>, | ||
}, | ||
|
||
/// The proof request timed out. | ||
#[error("Proof request 0x{} timed out", hex::encode(.request_id))] | ||
RequestTimedOut { | ||
/// The ID of the request that timed out. | ||
request_id: Vec<u8>, | ||
}, | ||
|
||
/// An error occurred while interacting with the RPC server. | ||
#[error("RPC error")] | ||
RpcError(#[from] Status), | ||
|
||
/// An unknown error occurred. | ||
#[error("Other error: {0}")] | ||
Other(#[from] anyhow::Error), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.