pub enum RobinhoodChainError {
MissingApiKey,
Api {
status: u16,
message: String,
body: Value,
},
Transport(Error),
Json(Error),
Url(ParseError),
}Expand description
Error type returned by every fallible operation in the SDK.
Variants§
MissingApiKey
API key was missing or malformed at construction time.
Get a free key at https://madeonsol.com/pricing — Robinhood Chain coverage is bundled into every tier at no extra cost.
Api
API returned a non-2xx HTTP status.
Transport(Error)
reqwest transport error (DNS, TLS, connection reset, etc).
Json(Error)
JSON serialization or deserialization error.
Url(ParseError)
URL-building error (only fires for impossible parameter combinations).
Implementations§
Source§impl RobinhoodChainError
impl RobinhoodChainError
Sourcepub fn status(&self) -> Option<u16>
pub fn status(&self) -> Option<u16>
Returns the HTTP status code if this is an RobinhoodChainError::Api variant.
Sourcepub fn body(&self) -> Option<&Value>
pub fn body(&self) -> Option<&Value>
Returns the raw response body if this is an RobinhoodChainError::Api variant.
Trait Implementations§
Source§impl Debug for RobinhoodChainError
impl Debug for RobinhoodChainError
Source§impl Display for RobinhoodChainError
impl Display for RobinhoodChainError
Source§impl Error for RobinhoodChainError
impl Error for RobinhoodChainError
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 RobinhoodChainError
impl From<Error> for RobinhoodChainError
Source§impl From<Error> for RobinhoodChainError
impl From<Error> for RobinhoodChainError
Source§impl From<ParseError> for RobinhoodChainError
impl From<ParseError> for RobinhoodChainError
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for RobinhoodChainError
impl !UnwindSafe for RobinhoodChainError
impl Freeze for RobinhoodChainError
impl Send for RobinhoodChainError
impl Sync for RobinhoodChainError
impl Unpin for RobinhoodChainError
impl UnsafeUnpin for RobinhoodChainError
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