#[non_exhaustive]pub enum Error {
Show 13 variants
AccessDeniedException(AccessDeniedException),
ConflictException(ConflictException),
InternalServerException(InternalServerException),
InvalidInputException(InvalidInputException),
ResourceNotFoundException(ResourceNotFoundException),
RuntimeClientError(RuntimeClientError),
ServiceException(ServiceException),
ServiceQuotaExceededException(ServiceQuotaExceededException),
ThrottledException(ThrottledException),
ThrottlingException(ThrottlingException),
UnauthorizedException(UnauthorizedException),
ValidationException(ValidationException),
Unhandled(Unhandled),
}
Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AccessDeniedException(AccessDeniedException)
The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.
ConflictException(ConflictException)
The exception that occurs when the request conflicts with the current state of the resource. This can happen when trying to modify a resource that is currently being modified by another request, or when trying to create a resource that already exists.
InternalServerException(InternalServerException)
The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.
InvalidInputException(InvalidInputException)
The input fails to satisfy the constraints specified by AgentCore. Check your input values and try again.
ResourceNotFoundException(ResourceNotFoundException)
The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.
RuntimeClientError(RuntimeClientError)
The exception that occurs when there is an error in the runtime client. This can happen due to network issues, invalid configuration, or other client-side problems. Check the error message for specific details about the error.
ServiceException(ServiceException)
The service encountered an internal error. Try your request again later.
ServiceQuotaExceededException(ServiceQuotaExceededException)
The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.
ThrottledException(ThrottledException)
The request was denied due to request throttling. Reduce the frequency of requests and try again.
ThrottlingException(ThrottlingException)
The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.
This exception is thrown when the JWT bearer token is invalid or not found for OAuth bearer token based access
ValidationException(ValidationException)
The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.
Unhandled(Unhandled)
Unhandled
directly is not forwards compatible. Instead, match using a variable wildcard pattern and check .code()
:
err if err.code() == Some("SpecificExceptionCode") => { /* handle the error */ }
See ProvideErrorMetadata
for what information is available for the error.An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
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
Source§impl From<BuildError> for Error
impl From<BuildError> for Error
Source§fn from(value: BuildError) -> Self
fn from(value: BuildError) -> Self
Source§impl From<CodeInterpreterStreamOutputError> for Error
impl From<CodeInterpreterStreamOutputError> for Error
Source§fn from(err: CodeInterpreterStreamOutputError) -> Self
fn from(err: CodeInterpreterStreamOutputError) -> Self
Source§impl From<CreateEventError> for Error
impl From<CreateEventError> for Error
Source§fn from(err: CreateEventError) -> Self
fn from(err: CreateEventError) -> Self
Source§impl From<DeleteEventError> for Error
impl From<DeleteEventError> for Error
Source§fn from(err: DeleteEventError) -> Self
fn from(err: DeleteEventError) -> Self
Source§impl From<DeleteMemoryRecordError> for Error
impl From<DeleteMemoryRecordError> for Error
Source§fn from(err: DeleteMemoryRecordError) -> Self
fn from(err: DeleteMemoryRecordError) -> Self
Source§impl From<GetBrowserSessionError> for Error
impl From<GetBrowserSessionError> for Error
Source§fn from(err: GetBrowserSessionError) -> Self
fn from(err: GetBrowserSessionError) -> Self
Source§impl From<GetCodeInterpreterSessionError> for Error
impl From<GetCodeInterpreterSessionError> for Error
Source§fn from(err: GetCodeInterpreterSessionError) -> Self
fn from(err: GetCodeInterpreterSessionError) -> Self
Source§impl From<GetEventError> for Error
impl From<GetEventError> for Error
Source§fn from(err: GetEventError) -> Self
fn from(err: GetEventError) -> Self
Source§impl From<GetMemoryRecordError> for Error
impl From<GetMemoryRecordError> for Error
Source§fn from(err: GetMemoryRecordError) -> Self
fn from(err: GetMemoryRecordError) -> Self
Source§impl From<GetResourceApiKeyError> for Error
impl From<GetResourceApiKeyError> for Error
Source§fn from(err: GetResourceApiKeyError) -> Self
fn from(err: GetResourceApiKeyError) -> Self
Source§impl From<GetResourceOauth2TokenError> for Error
impl From<GetResourceOauth2TokenError> for Error
Source§fn from(err: GetResourceOauth2TokenError) -> Self
fn from(err: GetResourceOauth2TokenError) -> Self
Source§impl From<GetWorkloadAccessTokenError> for Error
impl From<GetWorkloadAccessTokenError> for Error
Source§fn from(err: GetWorkloadAccessTokenError) -> Self
fn from(err: GetWorkloadAccessTokenError) -> Self
Source§impl From<GetWorkloadAccessTokenForJWTError> for Error
impl From<GetWorkloadAccessTokenForJWTError> for Error
Source§fn from(err: GetWorkloadAccessTokenForJWTError) -> Self
fn from(err: GetWorkloadAccessTokenForJWTError) -> Self
Source§impl From<GetWorkloadAccessTokenForUserIdError> for Error
impl From<GetWorkloadAccessTokenForUserIdError> for Error
Source§fn from(err: GetWorkloadAccessTokenForUserIdError) -> Self
fn from(err: GetWorkloadAccessTokenForUserIdError) -> Self
Source§impl From<InvokeAgentRuntimeError> for Error
impl From<InvokeAgentRuntimeError> for Error
Source§fn from(err: InvokeAgentRuntimeError) -> Self
fn from(err: InvokeAgentRuntimeError) -> Self
Source§impl From<InvokeCodeInterpreterError> for Error
impl From<InvokeCodeInterpreterError> for Error
Source§fn from(err: InvokeCodeInterpreterError) -> Self
fn from(err: InvokeCodeInterpreterError) -> Self
Source§impl From<ListActorsError> for Error
impl From<ListActorsError> for Error
Source§fn from(err: ListActorsError) -> Self
fn from(err: ListActorsError) -> Self
Source§impl From<ListBrowserSessionsError> for Error
impl From<ListBrowserSessionsError> for Error
Source§fn from(err: ListBrowserSessionsError) -> Self
fn from(err: ListBrowserSessionsError) -> Self
Source§impl From<ListCodeInterpreterSessionsError> for Error
impl From<ListCodeInterpreterSessionsError> for Error
Source§fn from(err: ListCodeInterpreterSessionsError) -> Self
fn from(err: ListCodeInterpreterSessionsError) -> Self
Source§impl From<ListEventsError> for Error
impl From<ListEventsError> for Error
Source§fn from(err: ListEventsError) -> Self
fn from(err: ListEventsError) -> Self
Source§impl From<ListMemoryRecordsError> for Error
impl From<ListMemoryRecordsError> for Error
Source§fn from(err: ListMemoryRecordsError) -> Self
fn from(err: ListMemoryRecordsError) -> Self
Source§impl From<ListSessionsError> for Error
impl From<ListSessionsError> for Error
Source§fn from(err: ListSessionsError) -> Self
fn from(err: ListSessionsError) -> Self
Source§impl From<RetrieveMemoryRecordsError> for Error
impl From<RetrieveMemoryRecordsError> for Error
Source§fn from(err: RetrieveMemoryRecordsError) -> Self
fn from(err: RetrieveMemoryRecordsError) -> Self
Source§impl<R> From<SdkError<CodeInterpreterStreamOutputError, R>> for Error
impl<R> From<SdkError<CodeInterpreterStreamOutputError, R>> for Error
Source§fn from(err: SdkError<CodeInterpreterStreamOutputError, R>) -> Self
fn from(err: SdkError<CodeInterpreterStreamOutputError, R>) -> Self
Source§impl<R> From<SdkError<CreateEventError, R>> for Error
impl<R> From<SdkError<CreateEventError, R>> for Error
Source§fn from(err: SdkError<CreateEventError, R>) -> Self
fn from(err: SdkError<CreateEventError, R>) -> Self
Source§impl<R> From<SdkError<DeleteEventError, R>> for Error
impl<R> From<SdkError<DeleteEventError, R>> for Error
Source§fn from(err: SdkError<DeleteEventError, R>) -> Self
fn from(err: SdkError<DeleteEventError, R>) -> Self
Source§impl<R> From<SdkError<DeleteMemoryRecordError, R>> for Error
impl<R> From<SdkError<DeleteMemoryRecordError, R>> for Error
Source§fn from(err: SdkError<DeleteMemoryRecordError, R>) -> Self
fn from(err: SdkError<DeleteMemoryRecordError, R>) -> Self
Source§impl<R> From<SdkError<GetBrowserSessionError, R>> for Error
impl<R> From<SdkError<GetBrowserSessionError, R>> for Error
Source§fn from(err: SdkError<GetBrowserSessionError, R>) -> Self
fn from(err: SdkError<GetBrowserSessionError, R>) -> Self
Source§impl<R> From<SdkError<GetCodeInterpreterSessionError, R>> for Error
impl<R> From<SdkError<GetCodeInterpreterSessionError, R>> for Error
Source§fn from(err: SdkError<GetCodeInterpreterSessionError, R>) -> Self
fn from(err: SdkError<GetCodeInterpreterSessionError, R>) -> Self
Source§impl<R> From<SdkError<GetEventError, R>> for Error
impl<R> From<SdkError<GetEventError, R>> for Error
Source§fn from(err: SdkError<GetEventError, R>) -> Self
fn from(err: SdkError<GetEventError, R>) -> Self
Source§impl<R> From<SdkError<GetMemoryRecordError, R>> for Error
impl<R> From<SdkError<GetMemoryRecordError, R>> for Error
Source§fn from(err: SdkError<GetMemoryRecordError, R>) -> Self
fn from(err: SdkError<GetMemoryRecordError, R>) -> Self
Source§impl<R> From<SdkError<GetResourceApiKeyError, R>> for Error
impl<R> From<SdkError<GetResourceApiKeyError, R>> for Error
Source§fn from(err: SdkError<GetResourceApiKeyError, R>) -> Self
fn from(err: SdkError<GetResourceApiKeyError, R>) -> Self
Source§impl<R> From<SdkError<GetResourceOauth2TokenError, R>> for Error
impl<R> From<SdkError<GetResourceOauth2TokenError, R>> for Error
Source§fn from(err: SdkError<GetResourceOauth2TokenError, R>) -> Self
fn from(err: SdkError<GetResourceOauth2TokenError, R>) -> Self
Source§impl<R> From<SdkError<GetWorkloadAccessTokenError, R>> for Error
impl<R> From<SdkError<GetWorkloadAccessTokenError, R>> for Error
Source§fn from(err: SdkError<GetWorkloadAccessTokenError, R>) -> Self
fn from(err: SdkError<GetWorkloadAccessTokenError, R>) -> Self
Source§impl<R> From<SdkError<GetWorkloadAccessTokenForJWTError, R>> for Error
impl<R> From<SdkError<GetWorkloadAccessTokenForJWTError, R>> for Error
Source§fn from(err: SdkError<GetWorkloadAccessTokenForJWTError, R>) -> Self
fn from(err: SdkError<GetWorkloadAccessTokenForJWTError, R>) -> Self
Source§impl<R> From<SdkError<GetWorkloadAccessTokenForUserIdError, R>> for Error
impl<R> From<SdkError<GetWorkloadAccessTokenForUserIdError, R>> for Error
Source§fn from(err: SdkError<GetWorkloadAccessTokenForUserIdError, R>) -> Self
fn from(err: SdkError<GetWorkloadAccessTokenForUserIdError, R>) -> Self
Source§impl<R> From<SdkError<InvokeAgentRuntimeError, R>> for Error
impl<R> From<SdkError<InvokeAgentRuntimeError, R>> for Error
Source§fn from(err: SdkError<InvokeAgentRuntimeError, R>) -> Self
fn from(err: SdkError<InvokeAgentRuntimeError, R>) -> Self
Source§impl<R> From<SdkError<InvokeCodeInterpreterError, R>> for Error
impl<R> From<SdkError<InvokeCodeInterpreterError, R>> for Error
Source§fn from(err: SdkError<InvokeCodeInterpreterError, R>) -> Self
fn from(err: SdkError<InvokeCodeInterpreterError, R>) -> Self
Source§impl<R> From<SdkError<ListActorsError, R>> for Error
impl<R> From<SdkError<ListActorsError, R>> for Error
Source§fn from(err: SdkError<ListActorsError, R>) -> Self
fn from(err: SdkError<ListActorsError, R>) -> Self
Source§impl<R> From<SdkError<ListBrowserSessionsError, R>> for Error
impl<R> From<SdkError<ListBrowserSessionsError, R>> for Error
Source§fn from(err: SdkError<ListBrowserSessionsError, R>) -> Self
fn from(err: SdkError<ListBrowserSessionsError, R>) -> Self
Source§impl<R> From<SdkError<ListCodeInterpreterSessionsError, R>> for Error
impl<R> From<SdkError<ListCodeInterpreterSessionsError, R>> for Error
Source§fn from(err: SdkError<ListCodeInterpreterSessionsError, R>) -> Self
fn from(err: SdkError<ListCodeInterpreterSessionsError, R>) -> Self
Source§impl<R> From<SdkError<ListEventsError, R>> for Error
impl<R> From<SdkError<ListEventsError, R>> for Error
Source§fn from(err: SdkError<ListEventsError, R>) -> Self
fn from(err: SdkError<ListEventsError, R>) -> Self
Source§impl<R> From<SdkError<ListMemoryRecordsError, R>> for Error
impl<R> From<SdkError<ListMemoryRecordsError, R>> for Error
Source§fn from(err: SdkError<ListMemoryRecordsError, R>) -> Self
fn from(err: SdkError<ListMemoryRecordsError, R>) -> Self
Source§impl<R> From<SdkError<ListSessionsError, R>> for Error
impl<R> From<SdkError<ListSessionsError, R>> for Error
Source§fn from(err: SdkError<ListSessionsError, R>) -> Self
fn from(err: SdkError<ListSessionsError, R>) -> Self
Source§impl<R> From<SdkError<RetrieveMemoryRecordsError, R>> for Error
impl<R> From<SdkError<RetrieveMemoryRecordsError, R>> for Error
Source§fn from(err: SdkError<RetrieveMemoryRecordsError, R>) -> Self
fn from(err: SdkError<RetrieveMemoryRecordsError, R>) -> Self
Source§impl<R> From<SdkError<StartBrowserSessionError, R>> for Error
impl<R> From<SdkError<StartBrowserSessionError, R>> for Error
Source§fn from(err: SdkError<StartBrowserSessionError, R>) -> Self
fn from(err: SdkError<StartBrowserSessionError, R>) -> Self
Source§impl<R> From<SdkError<StartCodeInterpreterSessionError, R>> for Error
impl<R> From<SdkError<StartCodeInterpreterSessionError, R>> for Error
Source§fn from(err: SdkError<StartCodeInterpreterSessionError, R>) -> Self
fn from(err: SdkError<StartCodeInterpreterSessionError, R>) -> Self
Source§impl<R> From<SdkError<StopBrowserSessionError, R>> for Error
impl<R> From<SdkError<StopBrowserSessionError, R>> for Error
Source§fn from(err: SdkError<StopBrowserSessionError, R>) -> Self
fn from(err: SdkError<StopBrowserSessionError, R>) -> Self
Source§impl<R> From<SdkError<StopCodeInterpreterSessionError, R>> for Error
impl<R> From<SdkError<StopCodeInterpreterSessionError, R>> for Error
Source§fn from(err: SdkError<StopCodeInterpreterSessionError, R>) -> Self
fn from(err: SdkError<StopCodeInterpreterSessionError, R>) -> Self
Source§impl<R> From<SdkError<UpdateBrowserStreamError, R>> for Error
impl<R> From<SdkError<UpdateBrowserStreamError, R>> for Error
Source§fn from(err: SdkError<UpdateBrowserStreamError, R>) -> Self
fn from(err: SdkError<UpdateBrowserStreamError, R>) -> Self
Source§impl From<StartBrowserSessionError> for Error
impl From<StartBrowserSessionError> for Error
Source§fn from(err: StartBrowserSessionError) -> Self
fn from(err: StartBrowserSessionError) -> Self
Source§impl From<StartCodeInterpreterSessionError> for Error
impl From<StartCodeInterpreterSessionError> for Error
Source§fn from(err: StartCodeInterpreterSessionError) -> Self
fn from(err: StartCodeInterpreterSessionError) -> Self
Source§impl From<StopBrowserSessionError> for Error
impl From<StopBrowserSessionError> for Error
Source§fn from(err: StopBrowserSessionError) -> Self
fn from(err: StopBrowserSessionError) -> Self
Source§impl From<StopCodeInterpreterSessionError> for Error
impl From<StopCodeInterpreterSessionError> for Error
Source§fn from(err: StopCodeInterpreterSessionError) -> Self
fn from(err: StopCodeInterpreterSessionError) -> Self
Source§impl From<UpdateBrowserStreamError> for Error
impl From<UpdateBrowserStreamError> for Error
Source§fn from(err: UpdateBrowserStreamError) -> Self
fn from(err: UpdateBrowserStreamError) -> Self
Source§impl ProvideErrorMetadata for Error
impl ProvideErrorMetadata for Error
Source§fn meta(&self) -> &ErrorMetadata
fn meta(&self) -> &ErrorMetadata
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the foreground set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red()
and
green()
, which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg()
:
use yansi::{Paint, Color};
painted.fg(Color::White);
Set foreground color to white using white()
.
use yansi::Paint;
painted.white();
Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self
with the background set to
value
.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red()
and
on_green()
, which have the same functionality but
are pithier.
§Example
Set background color to red using fg()
:
use yansi::{Paint, Color};
painted.bg(Color::Red);
Set background color to red using on_red()
.
use yansi::Paint;
painted.on_red();
Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute
value
.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold()
and
underline()
, which have the same functionality
but are pithier.
§Example
Make text bold using attr()
:
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);
Make text bold using using bold()
.
use yansi::Paint;
painted.bold();
Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi
Quirk
value
.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask()
and
wrap()
, which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk()
:
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);
Enable wrapping using wrap()
.
use yansi::Paint;
painted.wrap();
Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting()
due to conflicts with Vec::clear()
.
The clear()
method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition
value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted
only when both stdout
and stderr
are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);