#[non_exhaustive]pub enum EsiError {
Show 20 variants
EmptyClientValue(String),
MissingAuthenticationFlowInformation,
EmptySpec,
InvalidJWT(String),
JwtValidationFailed(Error),
InvalidStatusCode(u16),
InvalidUserAgentHeader(InvalidHeaderValue),
ReqwestError(Error),
HttpMethodError(InvalidMethod),
MissingAuthentication,
UnknownOperationID(String),
FailedSpecParse(String),
FailedJsonParse(Error),
Timestamp(SystemTimeError),
HeaderReadError(ToStrError),
HeaderParseError(String, ParseIntError),
ErrorLimited(i64),
RateLimited {
group: Option<String>,
retry_after_secs: Option<u64>,
},
AccessTokenExpired,
NoRefreshTokenAvailable,
}Expand description
Errors that can occur when dealing with ESI.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EmptyClientValue(String)
Error that can be thrown if the EsiBuilder struct is
invalid when .build() is called.
MissingAuthenticationFlowInformation
Error that can be thrown if the EsiBuilder struct is
invalid when .build() is called.
You need to specify either a client secret or enable application auth
EmptySpec
You have to retrieve the ESI spec via Esi::update_spec
before making this call.
InvalidJWT(String)
Error that could be thrown if the access token JWT from SSO is invalid, whether due to tampering or some other reason.
JwtValidationFailed(Error)
Validation of the JWT failed.
InvalidStatusCode(u16)
Error that can be thrown by any function that makes HTTP calls our to external resources for response codes that aren’t valid as defined [by reqwest]. [by reqwest]: https://docs.rs/reqwest/0.10.6/reqwest/struct.StatusCode.html#method.is_success
InvalidUserAgentHeader(InvalidHeaderValue)
Error for if the provided user-agent header value has invalid characters.
ReqwestError(Error)
Error for if the underlying reqwest::Client could not be constructed.
HttpMethodError(InvalidMethod)
Error for if the String cannot be converted into a valid HTTP method.
MissingAuthentication
Error for if a request is made to an endpoint that requires authentication, but no access token is present in the Esi struct.
UnknownOperationID(String)
Error for not finding the passed operationId in the ESI OpenAPI spec.
FailedSpecParse(String)
Error for being unable to parse the OpenAPI spec from ESI.
FailedJsonParse(Error)
Error for being unable to parse JSON from anywhere.
Timestamp(SystemTimeError)
Error for being unable to get the current timestamp.
HeaderReadError(ToStrError)
Error for being unable to read response header.
HeaderParseError(String, ParseIntError)
Error for being unable to parse header value.
ErrorLimited(i64)
Error for enforcing ESI error limit
RateLimited
ESI answered 429 Too Many Requests: the rate-limit bucket for this
route group is empty. Wait retry_after_secs (from the Retry-After
header, when present) before calling routes in group again.
Fields
AccessTokenExpired
Error for the access token being used after expiring (and therefore being unable to be used for ESI) and no refresh token being present to fetch another access token.
NoRefreshTokenAvailable
Error when a access_token needs to be refreshed, but no refresh token could be found to refresh the access token
Trait Implementations§
Source§impl Error for EsiError
impl Error for EsiError
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()