pub struct RiotApiError { /* private fields */ }Expand description
An error that occurred while processing a Riot API request.
Implementations§
Source§impl RiotApiError
impl RiotApiError
Sourcepub fn source_reqwest_error(&self) -> &Error
👎Deprecated: Use reqwest_errors() or de_error() instead.
pub fn source_reqwest_error(&self) -> &Error
Use reqwest_errors() or de_error() instead.
Returns the final reqwest::Error, for the final failed request, or panics if this was a deserialization error.
Sourcepub fn reqwest_errors(&self) -> &[Error]
pub fn reqwest_errors(&self) -> &[Error]
Returns all reqwest::Errors across all retries, in the chronological order they occurred.
May be empty if there was a deserialization error.
Sourcepub fn de_error(&self) -> Option<&Error>
pub fn de_error(&self) -> Option<&Error>
Returns the final deserialization error if any occured.
Sourcepub fn retries(&self) -> u8
pub fn retries(&self) -> u8
The number of retires attempted. Zero means exactly one request, zero retries.
Sourcepub fn response(&self) -> Option<&Response>
pub fn response(&self) -> Option<&Response>
The failed, unparsed response.
Some(&reqwest::Response) if the request was sent and failed.
None if the request was not sent, OR if parsing the response JSON failed.
Sourcepub fn take_response(&mut self) -> Option<Response>
pub fn take_response(&mut self) -> Option<Response>
The failed response.
Some(reqwest::Response) if the request was sent and failed.
None if the request was not sent, OR if parsing the response JSON failed.
Sourcepub fn status_code(&self) -> Option<StatusCode>
pub fn status_code(&self) -> Option<StatusCode>
The failed response’s HTTP status code.
Some(reqwest::StatusCode) if the request was sent and failed, OR if parsing the response JSON failed.
None if the request was not sent.
Trait Implementations§
Source§impl Debug for RiotApiError
impl Debug for RiotApiError
Source§impl Display for RiotApiError
impl Display for RiotApiError
Source§impl Error for RiotApiError
impl Error for RiotApiError
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()