#[non_exhaustive]pub enum Error {
Show 21 variants
Configuration(String),
InvalidIdentifier {
kind: &'static str,
reason: &'static str,
},
CredentialsRejected {
code: i32,
name: Option<&'static str>,
},
SessionValidationRejected {
code: i32,
name: Option<&'static str>,
},
InconsistentResponseStatus {
success: bool,
code: i32,
},
MissingAuthenticationToken,
InvalidAuthenticationToken,
NotAuthenticated,
AmbiguousSessionValidation,
Provider(ProviderError),
Transport(Error),
UnexpectedStatus {
status: u16,
},
UnexpectedStatusResponse,
LocallyRateLimited {
kind: RateLimitKind,
retry_after: Duration,
},
ProviderRateLimited {
kind: RateLimitKind,
retry_after: Duration,
},
Url(ParseError),
ResponseTooLarge {
limit_bytes: usize,
},
Decode(Error),
Encode(Error),
AmbiguousMutation {
operation: &'static str,
code: Option<i32>,
name: Option<&'static str>,
},
BackgroundTaskFailed {
task: &'static str,
},
}Expand description
Errors returned by the ProjectX client.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Configuration(String)
Client configuration was invalid.
InvalidIdentifier
A provider identifier was invalid.
Fields
CredentialsRejected
The provider rejected the supplied authentication credentials.
Fields
SessionValidationRejected
The provider rejected validation of the current session.
Fields
InconsistentResponseStatus
The provider’s success flag and required error code disagreed.
The provider did not declare a rejection, so this reports the contradictory pair as received instead of naming a rejection code.
MissingAuthenticationToken
A successful authentication response omitted a usable bearer token.
InvalidAuthenticationToken
A provider authentication response contained an invalid bearer token.
NotAuthenticated
No authenticated bearer token is available.
AmbiguousSessionValidation
Session validation may have rotated the provider token, but no trustworthy response was received.
Provider(ProviderError)
The provider rejected an otherwise valid request.
Transport(Error)
The HTTP transport failed.
UnexpectedStatus
The provider returned a non-successful HTTP status.
UnexpectedStatusResponse
The provider status endpoint returned a body other than pong.
LocallyRateLimited
A request was not sent because the shared local budget was exhausted.
Fields
kind: RateLimitKindProvider budget that rejected local admission.
ProviderRateLimited
The provider rejected an authenticated request with HTTP 429.
Fields
kind: RateLimitKindProvider budget associated with the rejected endpoint.
Url(ParseError)
A URL could not be constructed.
ResponseTooLarge
A provider response exceeded the configured safety limit.
Decode(Error)
A provider response could not be decoded.
Encode(Error)
A request could not be encoded as JSON.
AmbiguousMutation
A money-moving mutation may have reached the provider but did not produce a trustworthy response.
A decoded provider rejection that is documented as pending, unknown, or
otherwise not a definitive rejection stays ambiguous, and carries the
provider’s code and published name so the caller can tell
OrderPending apart from an unrecognized future code.
Fields
BackgroundTaskFailed
A library-owned background task terminated unexpectedly.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()