pub enum DeriveHttpError {
Transport(String),
Http {
status: u16,
message: String,
},
JsonRpc {
code: i64,
message: String,
data: Option<Value>,
},
MissingResult {
method: String,
},
Decode(String),
Serde(Error),
Auth(AuthError),
MissingCredentials {
method: String,
},
}Expand description
Errors raised by the Derive HTTP client.
Variants§
Transport(String)
Network/transport failure with undefined venue outcome.
Http
HTTP-level failure (non-2xx without a JSON-RPC body, or 2xx without the expected envelope).
JsonRpc
JSON-RPC error envelope returned by the venue.
Fields
MissingResult
Successful envelope was missing the result field.
Decode(String)
Response body could not be decoded as JSON-RPC.
Serde(Error)
JSON (de)serialization failed for a request or response payload.
Auth(AuthError)
Auth header construction failed (e.g. clock skew, signer error).
MissingCredentials
Private endpoint invoked without credentials configured on the client.
Implementations§
Source§impl DeriveHttpError
impl DeriveHttpError
Sourcepub fn transport(msg: impl Into<String>) -> Self
pub fn transport(msg: impl Into<String>) -> Self
Constructs a DeriveHttpError::Transport error.
Sourcepub fn http(status: u16, message: impl Into<String>) -> Self
pub fn http(status: u16, message: impl Into<String>) -> Self
Constructs a DeriveHttpError::Http error.
Sourcepub fn decode(msg: impl Into<String>) -> Self
pub fn decode(msg: impl Into<String>) -> Self
Constructs a DeriveHttpError::Decode error.
Sourcepub fn is_transport_error(&self) -> bool
pub fn is_transport_error(&self) -> bool
Returns true for errors that did not reach the venue (transport,
timeout). Callers reconciling order state should treat these as
“unknown” rather than “rejected”.
Trait Implementations§
Source§impl Debug for DeriveHttpError
impl Debug for DeriveHttpError
Source§impl Display for DeriveHttpError
impl Display for DeriveHttpError
Source§impl Error for DeriveHttpError
impl Error for DeriveHttpError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<AuthError> for DeriveHttpError
impl From<AuthError> for DeriveHttpError
Source§impl From<DeriveHttpError> for DeriveError
impl From<DeriveHttpError> for DeriveError
Source§fn from(source: DeriveHttpError) -> Self
fn from(source: DeriveHttpError) -> Self
Source§impl From<Error> for DeriveHttpError
impl From<Error> for DeriveHttpError
Source§impl From<HttpClientError> for DeriveHttpError
impl From<HttpClientError> for DeriveHttpError
Source§fn from(value: HttpClientError) -> Self
fn from(value: HttpClientError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for DeriveHttpError
impl !UnwindSafe for DeriveHttpError
impl Freeze for DeriveHttpError
impl Send for DeriveHttpError
impl Sync for DeriveHttpError
impl Unpin for DeriveHttpError
impl UnsafeUnpin for DeriveHttpError
Blanket Implementations§
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more