Enum aws_credential_types::provider::error::TokenError
source · pub enum TokenError {
TokenNotLoaded(TokenNotLoaded),
ProviderTimedOut(ProviderTimedOut),
InvalidConfiguration(InvalidConfiguration),
ProviderError(ProviderError),
Unhandled(Unhandled),
}
Expand description
Error returned when an access token provider fails to provide an access token.
Variants§
TokenNotLoaded(TokenNotLoaded)
This provider couldn’t provide a token.
ProviderTimedOut(ProviderTimedOut)
Loading a token from this provider exceeded the maximum allowed time.
InvalidConfiguration(InvalidConfiguration)
The provider was given invalid configuration.
For example, a syntax error in ~/.aws/config
.
ProviderError(ProviderError)
The provider experienced an error during credential resolution.
Unhandled(Unhandled)
An unexpected error occurred during token resolution.
If the error is something that can occur during expected usage of a provider, ProviderError
should be returned instead. Unhandled is reserved for exceptional cases, for example:
- Returned data not UTF-8
- A provider returns data that is missing required fields
Implementations§
source§impl TokenError
impl TokenError
sourcepub fn not_loaded(
source: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
pub fn not_loaded( source: impl Into<Box<dyn Error + Send + Sync + 'static>> ) -> Self
The access token provider couldn’t provide a token.
This error indicates the token provider was not enable or no configuration was set.
This contrasts with invalid_configuration
, indicating
that the provider was configured in some way, but certain settings were invalid.
sourcepub fn unhandled(
source: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
pub fn unhandled( source: impl Into<Box<dyn Error + Send + Sync + 'static>> ) -> Self
An unexpected error occurred loading an access token from this provider.
Unhandled errors should not occur during normal operation and should be reserved for exceptional cases, such as a JSON API returning an output that was not parseable as JSON.
sourcepub fn provider_error(
source: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
pub fn provider_error( source: impl Into<Box<dyn Error + Send + Sync + 'static>> ) -> Self
The access token provider returned an error.
sourcepub fn invalid_configuration(
source: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
pub fn invalid_configuration( source: impl Into<Box<dyn Error + Send + Sync + 'static>> ) -> Self
The provided configuration for a provider was invalid.
sourcepub fn provider_timed_out(timeout_duration: Duration) -> Self
pub fn provider_timed_out(timeout_duration: Duration) -> Self
The access token provider did not provide a token within an allotted amount of time.