pub enum QuestradeError {
Http(Error),
Api {
status: StatusCode,
body: String,
},
RateLimited {
retries: u32,
},
TokenRefresh {
status: StatusCode,
body: String,
},
Deserialization(Error),
DateTime {
context: String,
source: Box<dyn Error + Send + Sync>,
},
SymbolNotFound(String),
EmptyResponse(String),
}Expand description
Errors returned by the Questrade API client.
Variants§
Http(Error)
An HTTP/network error from the underlying reqwest client.
Api
The Questrade API returned a non-success status code.
Fields
§
status: StatusCodeHTTP status code returned by the API.
RateLimited
Rate-limited (HTTP 429) after exhausting all retry attempts.
TokenRefresh
OAuth token refresh failed with a non-success status.
Fields
§
status: StatusCodeHTTP status code from the auth server.
Deserialization(Error)
Failed to deserialize a JSON response body.
DateTime
A datetime string could not be formatted or parsed.
Fields
SymbolNotFound(String)
A symbol lookup returned no matching result.
EmptyResponse(String)
A response was expected to contain at least one item but was empty.
Trait Implementations§
Source§impl Debug for QuestradeError
impl Debug for QuestradeError
Source§impl Display for QuestradeError
impl Display for QuestradeError
Source§impl Error for QuestradeError
impl Error for QuestradeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for QuestradeError
impl From<Error> for QuestradeError
Auto Trait Implementations§
impl Freeze for QuestradeError
impl !RefUnwindSafe for QuestradeError
impl Send for QuestradeError
impl Sync for QuestradeError
impl Unpin for QuestradeError
impl UnsafeUnpin for QuestradeError
impl !UnwindSafe for QuestradeError
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
Mutably borrows from an owned value. Read more
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.