pub enum ClientError<Endpoint: Debug + Display> {
Show 16 variants
InvalidSystemId,
InvalidApiKey,
DisabledApiKey,
ReadOnlyKey,
BadApiKey,
RateLimitExceeded,
DonationModeRequired,
InaccessibleSystemId,
NotFound,
UnrecognisedStatusCode(StatusCode, Option<String>),
Reqwest(Error),
Parse(Error),
Write(Box<IntoInnerError<Writer<Vec<u8>>>>),
RateLimitParse(RateLimitError),
MissingField,
EndpointSpecific(Endpoint),
}Expand description
Errors that can occur when using the Client.
§Endpoint-Specific Errors
A ClientError may contain an endpoint-specific error.
Most endpoints return a ClientError with NoEndpointSpecificError, indicating that no endpoint-specific
errors can result from using the endpoint.
Some endpoints have their own error types, such as AddOutputError, which is returned by the
crate::Client::add_outputs endpoint.
Variants§
InvalidSystemId
The provided system ID is invalid.
InvalidApiKey
The provided API key is invalid.
DisabledApiKey
The provided API key has not been enabled in the Settings.
ReadOnlyKey
The provided API key is a read-only key and cannot access the requested service which updates system data. Use the standard key to update system data.
BadApiKey
The provided system ID and API key combination is invalid, or the API key is missing, invalid, or inactive.
RateLimitExceeded
The maximum number of requests per hour has been reached for the API key.
The rate limit will refresh at the time specified by the returned
RateLimit struct.
DonationModeRequired
Donation mode is required for this request.
InaccessibleSystemId
Another system ID was requested by an account without donation mode enabled.
NotFound
The requested data were not found.
UnrecognisedStatusCode(StatusCode, Option<String>)
An unrecognised unsuccessful HTTP status code was returned.
Reqwest(Error)
An error occurred while making the request.
Parse(Error)
Deserialisation error.
Write(Box<IntoInnerError<Writer<Vec<u8>>>>)
Error writing CSV data to a buffer.
RateLimitParse(RateLimitError)
Failed to parse rate limit information from the response’s HTTP headers.
MissingField
Missing field in API response.
EndpointSpecific(Endpoint)
An endpoint-specific error occurred.
Trait Implementations§
Source§impl<Endpoint> Error for ClientError<Endpoint>
impl<Endpoint> Error for ClientError<Endpoint>
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
Source§impl From<AddOutputError> for ClientError<AddOutputError>
impl From<AddOutputError> for ClientError<AddOutputError>
Source§fn from(error: AddOutputError) -> Self
fn from(error: AddOutputError) -> Self
Source§impl From<AddStatusError> for ClientError<AddStatusError>
impl From<AddStatusError> for ClientError<AddStatusError>
Source§fn from(error: AddStatusError) -> Self
fn from(error: AddStatusError) -> Self
Source§impl<Endpoint> From<Error> for ClientError<Endpoint>
impl<Endpoint> From<Error> for ClientError<Endpoint>
Source§impl<Endpoint> From<Error> for ClientError<Endpoint>
impl<Endpoint> From<Error> for ClientError<Endpoint>
Source§impl From<PostSystemError> for ClientError<PostSystemError>
impl From<PostSystemError> for ClientError<PostSystemError>
Source§fn from(error: PostSystemError) -> Self
fn from(error: PostSystemError) -> Self
Source§impl<Endpoint> From<RateLimitError> for ClientError<Endpoint>
impl<Endpoint> From<RateLimitError> for ClientError<Endpoint>
Source§fn from(error: RateLimitError) -> Self
fn from(error: RateLimitError) -> Self
Auto Trait Implementations§
impl<Endpoint> Freeze for ClientError<Endpoint>where
Endpoint: Freeze,
impl<Endpoint> !RefUnwindSafe for ClientError<Endpoint>
impl<Endpoint> Send for ClientError<Endpoint>where
Endpoint: Send,
impl<Endpoint> Sync for ClientError<Endpoint>where
Endpoint: Sync,
impl<Endpoint> Unpin for ClientError<Endpoint>where
Endpoint: Unpin,
impl<Endpoint> !UnwindSafe for ClientError<Endpoint>
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
§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>
§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.