pub enum RpcError {
Connection {
source: Error,
},
Request {
status: Box<Status>,
},
IntoProto {
source: ProtoError,
},
InvalidUrl {
source: Error,
},
}Expand description
Errors that can occur when using the BaseRpcClient
Variants§
Connection
Failed to establish a connection to base layer
This error occurs when the client cannot connect to the specified base layer URL, typically due to network issues or because the node is not running.
Request
The RPC request was rejected by base layer
This error occurs when the request is received by the base layer but cannot be processed, such as when requesting a non-existent vault or submitting an invalid transaction.
IntoProto
Failed to convert between protocol buffer and native format
This error occurs when there’s a problem converting between the wire format (protocol buffers) and the native Rust types, typically due to missing or malformed data.
Fields
source: ProtoErrorThe underlying conversion error
InvalidUrl
Failed to parse base layer URL
This error occurs when the URL provided to connect to the base layer is malformed or cannot be parsed.
Fields
source: ErrorThe underlying HTTP error
Implementations§
Source§impl RpcError
impl RpcError
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Returns true if the underlying error is a gRPC not found status.
Sourcepub fn is_failed_precondition(&self) -> bool
pub fn is_failed_precondition(&self) -> bool
Returns true if the underlying error is a gRPC failed precondition status.
Trait Implementations§
Source§impl Error for RpcError
impl Error for RpcError
Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
Auto Trait Implementations§
impl Freeze for RpcError
impl !RefUnwindSafe for RpcError
impl Send for RpcError
impl Sync for RpcError
impl Unpin for RpcError
impl !UnwindSafe for RpcError
Blanket Implementations§
§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request