#[non_exhaustive]pub enum CredentialsError {
CredentialsNotLoaded(CredentialsNotLoaded),
ProviderTimedOut(ProviderTimedOut),
InvalidConfiguration(InvalidConfiguration),
ProviderError(ProviderError),
Unhandled(Unhandled),
}Expand description
Error returned when credentials failed to load.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CredentialsNotLoaded(CredentialsNotLoaded)
No credentials were available for this provider
ProviderTimedOut(ProviderTimedOut)
Loading credentials from this provider exceeded the maximum allowed duration
InvalidConfiguration(InvalidConfiguration)
The provider was given an invalid configuration
For example:
- syntax error in ~/.aws/config
- assume role profile that forms an infinite loop
ProviderError(ProviderError)
The provider experienced an error during credential resolution
This may include errors like a 503 from STS or a file system error when attempting to read a configuration file.
Unhandled(Unhandled)
An unexpected error occurred during credential 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 CredentialsError
impl CredentialsError
Sourcepub fn not_loaded(
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> CredentialsError
pub fn not_loaded( source: impl Into<Box<dyn Error + Send + Sync>>, ) -> CredentialsError
The credentials provider did not provide credentials
This error indicates the credentials 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 not_loaded_no_source() -> CredentialsError
pub fn not_loaded_no_source() -> CredentialsError
The credentials provider did not provide credentials
This error indicates the credentials 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>>,
) -> CredentialsError
pub fn unhandled( source: impl Into<Box<dyn Error + Send + Sync>>, ) -> CredentialsError
An unexpected error occurred loading credentials 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>>,
) -> CredentialsError
pub fn provider_error( source: impl Into<Box<dyn Error + Send + Sync>>, ) -> CredentialsError
The credentials provider returned an error
Provider errors may occur during normal use of a credentials provider, e.g. a 503 when retrieving credentials from IMDS.
Sourcepub fn invalid_configuration(
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> CredentialsError
pub fn invalid_configuration( source: impl Into<Box<dyn Error + Send + Sync>>, ) -> CredentialsError
The provided configuration for a provider was invalid
Sourcepub fn provider_timed_out(timeout_duration: Duration) -> CredentialsError
pub fn provider_timed_out(timeout_duration: Duration) -> CredentialsError
The credentials provider did not provide credentials within an allotted duration
Trait Implementations§
Source§impl Debug for CredentialsError
impl Debug for CredentialsError
Source§impl Display for CredentialsError
impl Display for CredentialsError
Source§impl Error for CredentialsError
impl Error for CredentialsError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for CredentialsError
impl !UnwindSafe for CredentialsError
impl Freeze for CredentialsError
impl Send for CredentialsError
impl Sync for CredentialsError
impl Unpin for CredentialsError
impl UnsafeUnpin for CredentialsError
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more