Struct riven::RiotApiError
source · pub struct RiotApiError { /* private fields */ }
Expand description
An error that occurred while processing a Riot API request.
Although Riven may make multiple requests due to retries, this will always contain exactly one reqwest::Error for the final request which failed.
Implementations§
source§impl RiotApiError
impl RiotApiError
sourcepub fn source_reqwest_error(&self) -> &Error
pub fn source_reqwest_error(&self) -> &Error
The reqwest::Error for the final failed request.
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 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.