pub enum BetfairHttpError {
MissingCredentials,
LoginFailed {
status: String,
},
BetfairError {
code: i64,
message: String,
},
JsonError(String),
NetworkError(String),
InvalidConfiguration(String),
Timeout(String),
Canceled(String),
UnexpectedStatus {
status: u16,
body: String,
},
}Expand description
Represents HTTP client errors for the Betfair adapter.
Variants§
MissingCredentials
Missing API credentials.
LoginFailed
Login failed with a non-success status.
BetfairError
Betfair JSON-RPC error with code and message.
JsonError(String)
JSON serialization/deserialization error.
NetworkError(String)
Network-related error.
InvalidConfiguration(String)
Invalid client configuration.
Timeout(String)
Request timeout.
Canceled(String)
Request canceled.
UnexpectedStatus
Unexpected HTTP status.
Implementations§
Source§impl BetfairHttpError
impl BetfairHttpError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Returns whether this error is retryable.
Sourcepub fn is_login_failed(&self) -> bool
pub fn is_login_failed(&self) -> bool
Returns whether this is a login/auth rejection from the Identity API.
keep_alive returns this when the session is expired or unrecognised.
Transient errors (network, timeout) return different variants.
Sourcepub fn is_session_error(&self) -> bool
pub fn is_session_error(&self) -> bool
Returns whether this error is a session expiry that should trigger reconnection.
Session errors (NO_SESSION, INVALID_SESSION_INFORMATION) occur every
12-24 hours and are resolved by re-authenticating. Undocumented JSON-RPC
server errors (-32099) are also treated as session errors.
Sourcepub fn is_rate_limit_error(&self) -> bool
pub fn is_rate_limit_error(&self) -> bool
Returns whether this error is a rate limit (TOO_MANY_REQUESTS) error.
Sourcepub fn is_order_placement_ambiguous(&self) -> bool
pub fn is_order_placement_ambiguous(&self) -> bool
Returns whether this error leaves order placement in an ambiguous state.
When true, the request may have been processed by Betfair despite the
error. Callers must NOT emit OrderRejected for ambiguous errors
because the order may be live on the exchange. The OCM stream will
reconcile the order via its customerOrderRef.
Trait Implementations§
Source§impl Clone for BetfairHttpError
impl Clone for BetfairHttpError
Source§fn clone(&self) -> BetfairHttpError
fn clone(&self) -> BetfairHttpError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BetfairHttpError
impl Debug for BetfairHttpError
Source§impl Display for BetfairHttpError
impl Display for BetfairHttpError
Source§impl Error for BetfairHttpError
impl Error for BetfairHttpError
1.30.0 · 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 BetfairHttpError
impl From<Error> for BetfairHttpError
Auto Trait Implementations§
impl Freeze for BetfairHttpError
impl RefUnwindSafe for BetfairHttpError
impl Send for BetfairHttpError
impl Sync for BetfairHttpError
impl Unpin for BetfairHttpError
impl UnsafeUnpin for BetfairHttpError
impl UnwindSafe for BetfairHttpError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.