Skip to main content

ClientError

Enum ClientError 

Source
pub enum ClientError {
Show 26 variants Http(Error), Json(Error), InboundJson(Error), Signing { operation: String, source: BoxClientSource, }, SigningUnavailable(SigningUnavailableReason), Api { status: u16, message: String, }, RfqV2Api { status: u16, code: String, message: String, }, RfqV2ChangeFeedCursor { after_sequence: u64, next_after_sequence: u64, has_more: bool, }, RfqV2ProtocolViolation(String), RfqV2SubmissionAmbiguous { rfq_id: Option<Uuid>, operation_id: Uuid, source: Box<ClientError>, }, ApiSource { status: u16, source: BoxClientSource, }, WebSocket(String), InvalidInput(String), InvalidInputSource { context: String, source: BoxClientSource, }, RfqInput(RfqInputError), Onchain { operation: String, source: BoxClientSource, }, TransactionReverted { operation: &'static str, transaction_hash: Option<B256>, }, MissingAccountCreatedEvent, AccountCreatedManagerMismatch { observed: Address, expected: Address, }, AccountCreatedAddressMismatch { observed: Address, expected: Address, }, ArithmeticOverflow { operation: &'static str, }, WithdrawalSubmissionAmbiguous { action: String, route: String, account: AccountAddress, destination: AccountAddress, destination_dex: Option<u32>, amount: String, nonce: u64, source: Box<ClientError>, }, TeeSubmissionAmbiguous { action: String, route: String, nonce: u64, request_json: String, source: Box<ClientError>, }, TransactionSubmissionUnknown { operation: String, transaction_hash: B256, source: BoxClientSource, }, TransactionConfirmationUnknown { operation: String, transaction_hash: B256, source: BoxClientSource, }, MissingTransactionBlock { transaction_hash: B256, },
}
Expand description

Client error type.

Variants§

§

Http(Error)

HTTP request failed

§

Json(Error)

JSON serialization/deserialization failed

§

InboundJson(Error)

Decoding an inbound server frame failed. Inbound frames are parsed with Serde, whose default recursion limit bounds hostile nesting.

§

Signing

A concrete signing operation failed.

Fields

§operation: String
§

SigningUnavailable(SigningUnavailableReason)

The selected signer cannot perform the requested operation.

§

Api

API returned an error

Fields

§status: u16
§message: String
§

RfqV2Api

RFQ v2 response with its machine-readable domain code preserved.

Requires the rfq-v2 feature.

Fields

§status: u16
§code: String
§message: String
§

RfqV2ChangeFeedCursor

The signed change feed returned a non-progressing global cursor.

Requires the rfq-v2 feature.

Fields

§after_sequence: u64
§next_after_sequence: u64
§has_more: bool
§

RfqV2ProtocolViolation(String)

An RFQ v2 read broke a durable contract: a quote delivered twice across pages, retained history that vanished, or a page with more results and no cursor.

Requires the rfq-v2 feature.

§

RfqV2SubmissionAmbiguous

A mutation may have been applied: the request timed out, failed in transport, or got a 5xx. rfq_id is None for maker-wide actions (bulk withdrawal, cancel schedule). operation_id is the stable identity of the request: the object ID for create and publish, the operation ID otherwise. Reconcile by these IDs or resend only the identical signed request.

Requires the rfq-v2 feature.

Fields

§rfq_id: Option<Uuid>
§operation_id: Uuid
§

ApiSource

An API-shaped external response failed while retaining its concrete source.

Fields

§status: u16
§

WebSocket(String)

WebSocket error

§

InvalidInput(String)

Invalid input

§

InvalidInputSource

A concrete parser or validator rejected caller-provided input.

Fields

§context: String
§

RfqInput(RfqInputError)

Caller-side RFQ validation with the legacy public diagnostic text.

§

Onchain

A typed failure returned by the HyperEVM provider or contract binding.

Fields

§operation: String
§

TransactionReverted

A submitted transaction was confirmed as reverted.

Fields

§operation: &'static str
§transaction_hash: Option<B256>
§

MissingAccountCreatedEvent

A confirmed Factory transaction omitted its required creation event.

§

AccountCreatedManagerMismatch

The Factory event named a different manager from the submitting wallet.

Fields

§observed: Address
§expected: Address
§

AccountCreatedAddressMismatch

The Factory event named an account different from the simulated address.

Fields

§observed: Address
§expected: Address
§

ArithmeticOverflow

A checked client-side calculation overflowed.

Fields

§operation: &'static str
§

WithdrawalSubmissionAmbiguous

An HTTP withdrawal request may have reached the server before failing.

Fields

§action: String
§route: String
§destination: AccountAddress
§destination_dex: Option<u32>
§amount: String
§nonce: u64
§

TeeSubmissionAmbiguous

A signed TEE perp (or TEE API wallet) submission may have reached the server before failing: a transport error, a timeout, a 5xx, or a 2xx whose body did not decode. request_json is the exact signed body that was sent. Reconcile from venue or directive state, or resend exactly these bytes with HypercallClient::resend_tee_submission, which the server deduplicates. Never re-run the high-level method: a fresh nonce (and nonce-derived cloids) would sign a second action.

Fields

§action: String
§route: String
§nonce: u64
§request_json: String
§

TransactionSubmissionUnknown

A broadcast transaction has an unknown submission outcome.

Fields

§operation: String
§transaction_hash: B256
§

TransactionConfirmationUnknown

A broadcast transaction has an unknown confirmation outcome.

Fields

§operation: String
§transaction_hash: B256
§

MissingTransactionBlock

A confirmed receipt omitted its required block number.

Fields

§transaction_hash: B256

Implementations§

Source§

impl ClientError

Source

pub fn signing( operation: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self

Add operation context without discarding the concrete signer error.

Source

pub fn api_source( status: u16, source: impl Error + Send + Sync + 'static, ) -> Self

Preserve the legacy API error boundary without flattening the source.

Source

pub fn invalid_input( context: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self

Add input context without discarding the concrete parser error.

Source

pub fn api_error_code(&self) -> Option<String>

The stable code of an API error body ({"code": ..., "message": ...}), when this is an ClientError::Api whose body carries one.

For example unsupported_action, which the TEE perp routes return (HTTP 400) when the admitted enclave release does not enable an action kind such as TWAP or batch modify.

Source

pub fn is_unsupported_action(&self) -> bool

Whether the server refused the request because this deployment does not enable the action (400 unsupported_action). Nothing was signed at the venue or reserved; retrying the same action will not help until the operator enables it.

Source

pub fn is_connection_error(&self) -> bool

Returns true if this error indicates a connection-level failure (TCP connect error or request timeout), as opposed to an HTTP response error.

Trait Implementations§

Source§

impl Debug for ClientError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ClientError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for ClientError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for ClientError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ClientError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for ClientError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more