miden_client/remote_prover/
mod.rs1use alloc::boxed::Box;
2use alloc::string::{String, ToString};
3use core::error::Error as CoreError;
4
5use thiserror::Error;
6
7mod api_client;
8mod generated;
9mod tx_prover;
10
11pub use tx_prover::RemoteTransactionProver;
12
13#[derive(Debug, Error)]
18pub enum RemoteProverClientError {
19 #[error("invalid uri {0}")]
21 InvalidEndpoint(String),
22 #[error("failed to connect to prover {0}")]
24 ConnectionFailed(#[source] Box<dyn CoreError + Send + Sync + 'static>),
25 #[error("{error_msg}")]
27 Other {
28 error_msg: Box<str>,
29 source: Option<Box<dyn CoreError + Send + Sync + 'static>>,
30 },
31}
32
33impl From<RemoteProverClientError> for String {
34 fn from(err: RemoteProverClientError) -> Self {
35 err.to_string()
36 }
37}
38
39impl RemoteProverClientError {
40 pub fn other(message: impl Into<String>) -> Self {
43 let message: String = message.into();
44 Self::Other { error_msg: message.into(), source: None }
45 }
46
47 pub fn other_with_source(
50 message: impl Into<String>,
51 source: impl CoreError + Send + Sync + 'static,
52 ) -> Self {
53 let message: String = message.into();
54 Self::Other {
55 error_msg: message.into(),
56 source: Some(Box::new(source)),
57 }
58 }
59}