Enum aws_types::credentials::CredentialsError
source · [−]#[non_exhaustive]
pub enum CredentialsError {
CredentialsNotLoaded {
context: Box<dyn Error + Send + Sync + 'static>,
},
ProviderTimedOut(Duration),
InvalidConfiguration {
cause: Box<dyn Error + Send + Sync + 'static>,
},
ProviderError {
cause: Box<dyn Error + Send + Sync + 'static>,
},
Unhandled {
cause: Box<dyn Error + Send + Sync + 'static>,
},
}
Expand description
Error returned when credentials failed to load.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
CredentialsNotLoaded
Fields
This variant is marked as non-exhaustive
No credentials were available for this provider
ProviderTimedOut(Duration)
Loading credentials from this provider exceeded the maximum allowed duration
InvalidConfiguration
Fields
This variant is marked as non-exhaustive
The provider was given an invalid configuration
For example:
- syntax error in ~/.aws/config
- assume role profile that forms an infinite loop
ProviderError
Fields
This variant is marked as non-exhaustive
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
Fields
This variant is marked as non-exhaustive
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
sourceimpl CredentialsError
impl CredentialsError
sourcepub fn not_loaded(
context: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
pub fn not_loaded(
context: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
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(
cause: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
pub fn unhandled(
cause: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
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(
cause: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
pub fn provider_error(
cause: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
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(
cause: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
pub fn invalid_configuration(
cause: impl Into<Box<dyn Error + Send + Sync + 'static>>
) -> Self
The provided configuration for a provider was invalid
sourcepub fn provider_timed_out(context: Duration) -> Self
pub fn provider_timed_out(context: Duration) -> Self
The credentials provider did not provide credentials within an allotted duration
Trait Implementations
sourceimpl Debug for CredentialsError
impl Debug for CredentialsError
sourceimpl Display for CredentialsError
impl Display for CredentialsError
sourceimpl Error for CredentialsError
impl Error for CredentialsError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations
impl !RefUnwindSafe for CredentialsError
impl Send for CredentialsError
impl Sync for CredentialsError
impl Unpin for CredentialsError
impl !UnwindSafe for CredentialsError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more