pub enum OKXHttpError {
Show 14 variants
MissingCredentials,
OkxError {
error_code: String,
message: String,
},
RetryableOkxError {
error_code: String,
message: String,
retry_after: Option<Duration>,
},
RequestSerialization(String),
MalformedResponse(String),
ResponseDecoding(String),
ValidationError(String),
Canceled(String),
HttpClientError(HttpClientError),
RetryableStatus {
status: StatusCode,
body: String,
retry_after: Option<Duration>,
},
UnexpectedStatus {
status: StatusCode,
body: String,
},
OperationTimeout {
timeout_ms: u64,
},
RetryBudgetExceeded(String),
EmptyResponse,
}Expand description
A typed error enumeration for the OKX HTTP client.
Variants§
MissingCredentials
Error variant when credentials are missing but the request is authenticated.
OkxError
Errors returned directly by OKX (non-zero code).
RetryableOkxError
Temporary errors returned by OKX.
RequestSerialization(String)
Failure while serializing an outbound request.
MalformedResponse(String)
The response body is not valid JSON.
ResponseDecoding(String)
The response JSON does not match the expected schema.
ValidationError(String)
Parameter validation error.
Canceled(String)
Request was canceled, typically due to shutdown or disconnect.
HttpClientError(HttpClientError)
Wrapping the underlying HttpClientError from the network crate.
RetryableStatus
A temporary HTTP status without a decodable OKX error envelope.
UnexpectedStatus
Any permanent unknown HTTP status or unexpected response from OKX.
OperationTimeout
A single retry attempt exceeded its configured timeout.
RetryBudgetExceeded(String)
The retry elapsed-time budget was exhausted.
EmptyResponse
The venue returned a successful envelope with no result items.
Implementations§
Source§impl OKXHttpError
impl OKXHttpError
Sourcepub fn is_order_not_found(&self) -> bool
pub fn is_order_not_found(&self) -> bool
Returns whether OKX reported that the requested order does not exist.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns whether this error is retryable.
Sourcepub const fn retry_after(&self) -> Option<Duration>
pub const fn retry_after(&self) -> Option<Duration>
Returns the venue or transport-provided minimum retry delay.
Trait Implementations§
Source§impl Debug for OKXHttpError
impl Debug for OKXHttpError
Source§impl Display for OKXHttpError
impl Display for OKXHttpError
Source§impl Error for OKXHttpError
impl Error for OKXHttpError
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 OKXHttpError
impl From<Error> for OKXHttpError
Source§impl From<HttpClientError> for OKXHttpError
impl From<HttpClientError> for OKXHttpError
Source§impl From<OKXHttpError> for PyErr
impl From<OKXHttpError> for PyErr
Source§fn from(error: OKXHttpError) -> Self
fn from(error: OKXHttpError) -> Self
Auto Trait Implementations§
impl Freeze for OKXHttpError
impl RefUnwindSafe for OKXHttpError
impl Send for OKXHttpError
impl Sync for OKXHttpError
impl Unpin for OKXHttpError
impl UnsafeUnpin for OKXHttpError
impl UnwindSafe for OKXHttpError
Blanket Implementations§
impl<T> Allocation for T
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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