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.
The selected signer cannot perform the requested operation.
Api
API returned an error
RfqV2Api
RFQ v2 response with its machine-readable domain code preserved.
Requires the rfq-v2 feature.
RfqV2ChangeFeedCursor
The signed change feed returned a non-progressing global cursor.
Requires the rfq-v2 feature.
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.
ApiSource
An API-shaped external response failed while retaining its concrete source.
WebSocket(String)
WebSocket error
InvalidInput(String)
Invalid input
InvalidInputSource
A concrete parser or validator rejected caller-provided input.
RfqInput(RfqInputError)
Caller-side RFQ validation with the legacy public diagnostic text.
Onchain
A typed failure returned by the HyperEVM provider or contract binding.
TransactionReverted
A submitted transaction was confirmed as reverted.
MissingAccountCreatedEvent
A confirmed Factory transaction omitted its required creation event.
AccountCreatedManagerMismatch
The Factory event named a different manager from the submitting wallet.
AccountCreatedAddressMismatch
The Factory event named an account different from the simulated address.
ArithmeticOverflow
A checked client-side calculation overflowed.
WithdrawalSubmissionAmbiguous
An HTTP withdrawal request may have reached the server before failing.
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.
TransactionSubmissionUnknown
A broadcast transaction has an unknown submission outcome.
TransactionConfirmationUnknown
A broadcast transaction has an unknown confirmation outcome.
MissingTransactionBlock
A confirmed receipt omitted its required block number.
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn signing(
operation: impl Into<String>,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn signing( operation: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self
Add operation context without discarding the concrete signer error.
Sourcepub fn api_source(
status: u16,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn api_source( status: u16, source: impl Error + Send + Sync + 'static, ) -> Self
Preserve the legacy API error boundary without flattening the source.
Sourcepub fn invalid_input(
context: impl Into<String>,
source: impl Error + Send + Sync + 'static,
) -> Self
pub fn invalid_input( context: impl Into<String>, source: impl Error + Send + Sync + 'static, ) -> Self
Add input context without discarding the concrete parser error.
Sourcepub fn api_error_code(&self) -> Option<String>
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.
Sourcepub fn is_unsupported_action(&self) -> bool
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.
Sourcepub fn is_connection_error(&self) -> bool
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
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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<Error> for ClientError
impl From<Error> for ClientError
Source§impl From<Error> for ClientError
impl From<Error> for ClientError
Auto Trait Implementations§
impl !RefUnwindSafe for ClientError
impl !UnwindSafe for ClientError
impl Forget for ClientError
impl Freeze for ClientError
impl Move for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin for ClientError
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