pub type JsonRpcClientError = ClientError;Available on crate feature
client-api only.Aliased Type§
pub enum JsonRpcClientError {
Call(ErrorObject<'static>),
Transport(Box<dyn Error + Send + Sync>),
RestartNeeded(Arc<Error>),
ParseError(Error),
InvalidSubscriptionId,
InvalidRequestId(InvalidRequestId),
RequestTimeout,
Custom(String),
HttpNotImplemented,
EmptyBatchRequest(EmptyBatchRequest),
RegisterMethod(RegisterMethodError),
}Variants§
Call(ErrorObject<'static>)
JSON-RPC error which can occur when a JSON-RPC call fails.
Transport(Box<dyn Error + Send + Sync>)
Networking error or error on the low-level protocol layer.
RestartNeeded(Arc<Error>)
The background task has been terminated.
ParseError(Error)
Failed to parse the data.
InvalidSubscriptionId
Invalid subscription ID.
InvalidRequestId(InvalidRequestId)
Invalid request ID.
RequestTimeout
Request timeout
Custom(String)
Custom error.
HttpNotImplemented
Not implemented for HTTP clients.
EmptyBatchRequest(EmptyBatchRequest)
Empty batch request.
RegisterMethod(RegisterMethodError)
The error returned when registering a method or subscription failed.
Trait Implementations§
Source§impl JsonRpcClientErrorExt for JsonRpcClientError
Helpers to inspect the error type from the client implementation.
impl JsonRpcClientErrorExt for JsonRpcClientError
Helpers to inspect the error type from the client implementation.
Source§fn as_error_object(&self) -> Option<&ErrorObjectOwned>
fn as_error_object(&self) -> Option<&ErrorObjectOwned>
If this is a JSON-RPC error object, return a reference to it.
If submitting a transaction, these are usually pre-execution validity check failures, e.g.,
wrong signatures, equivocated objects, etc. Use ErrorObjectExt to extract more
information from those.