#[non_exhaustive]pub enum Error {
AccessDeniedException(AccessDeniedException),
DryRunOperation(DryRunOperation),
HomeRegionNotSetException(HomeRegionNotSetException),
InternalServerError(InternalServerError),
InvalidInputException(InvalidInputException),
PolicyErrorException(PolicyErrorException),
ResourceNotFoundException(ResourceNotFoundException),
ServiceUnavailableException(ServiceUnavailableException),
ThrottlingException(ThrottlingException),
UnauthorizedOperation(UnauthorizedOperation),
Unhandled(Unhandled),
}
Expand description
All possible error types for this service.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
AccessDeniedException(AccessDeniedException)
You do not have sufficient access to perform this action.
DryRunOperation(DryRunOperation)
Exception raised to indicate a successfully authorized action when the DryRun
flag is set to "true".
HomeRegionNotSetException(HomeRegionNotSetException)
The home region is not set. Set the home region to continue.
InternalServerError(InternalServerError)
Exception raised when an internal, configuration, or dependency error is encountered.
InvalidInputException(InvalidInputException)
Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.
PolicyErrorException(PolicyErrorException)
Exception raised when there are problems accessing Application Discovery Service (Application Discovery Service); most likely due to a misconfigured policy or the migrationhub-discovery
role is missing or not configured correctly.
ResourceNotFoundException(ResourceNotFoundException)
Exception raised when the request references a resource (Application Discovery Service configuration, update stream, migration task, etc.) that does not exist in Application Discovery Service (Application Discovery Service) or in Migration Hub's repository.
Exception raised when there is an internal, configuration, or dependency error encountered.
ThrottlingException(ThrottlingException)
The request was denied due to request throttling.
Exception raised to indicate a request was not authorized when the DryRun
flag is set to "true".
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<AssociateCreatedArtifactError> for Error
impl From<AssociateCreatedArtifactError> for Error
Source§fn from(err: AssociateCreatedArtifactError) -> Self
fn from(err: AssociateCreatedArtifactError) -> Self
Source§impl From<AssociateDiscoveredResourceError> for Error
impl From<AssociateDiscoveredResourceError> for Error
Source§fn from(err: AssociateDiscoveredResourceError) -> Self
fn from(err: AssociateDiscoveredResourceError) -> Self
Source§impl From<AssociateSourceResourceError> for Error
impl From<AssociateSourceResourceError> for Error
Source§fn from(err: AssociateSourceResourceError) -> Self
fn from(err: AssociateSourceResourceError) -> Self
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<CreateProgressUpdateStreamError> for Error
impl From<CreateProgressUpdateStreamError> for Error
Source§fn from(err: CreateProgressUpdateStreamError) -> Self
fn from(err: CreateProgressUpdateStreamError) -> Self
Source§impl From<DeleteProgressUpdateStreamError> for Error
impl From<DeleteProgressUpdateStreamError> for Error
Source§fn from(err: DeleteProgressUpdateStreamError) -> Self
fn from(err: DeleteProgressUpdateStreamError) -> Self
Source§impl From<DescribeApplicationStateError> for Error
impl From<DescribeApplicationStateError> for Error
Source§fn from(err: DescribeApplicationStateError) -> Self
fn from(err: DescribeApplicationStateError) -> Self
Source§impl From<DescribeMigrationTaskError> for Error
impl From<DescribeMigrationTaskError> for Error
Source§fn from(err: DescribeMigrationTaskError) -> Self
fn from(err: DescribeMigrationTaskError) -> Self
Source§impl From<DisassociateCreatedArtifactError> for Error
impl From<DisassociateCreatedArtifactError> for Error
Source§fn from(err: DisassociateCreatedArtifactError) -> Self
fn from(err: DisassociateCreatedArtifactError) -> Self
Source§impl From<DisassociateDiscoveredResourceError> for Error
impl From<DisassociateDiscoveredResourceError> for Error
Source§fn from(err: DisassociateDiscoveredResourceError) -> Self
fn from(err: DisassociateDiscoveredResourceError) -> Self
Source§impl From<DisassociateSourceResourceError> for Error
impl From<DisassociateSourceResourceError> for Error
Source§fn from(err: DisassociateSourceResourceError) -> Self
fn from(err: DisassociateSourceResourceError) -> Self
Source§impl From<ImportMigrationTaskError> for Error
impl From<ImportMigrationTaskError> for Error
Source§fn from(err: ImportMigrationTaskError) -> Self
fn from(err: ImportMigrationTaskError) -> Self
Source§impl From<ListApplicationStatesError> for Error
impl From<ListApplicationStatesError> for Error
Source§fn from(err: ListApplicationStatesError) -> Self
fn from(err: ListApplicationStatesError) -> Self
Source§impl From<ListCreatedArtifactsError> for Error
impl From<ListCreatedArtifactsError> for Error
Source§fn from(err: ListCreatedArtifactsError) -> Self
fn from(err: ListCreatedArtifactsError) -> Self
Source§impl From<ListDiscoveredResourcesError> for Error
impl From<ListDiscoveredResourcesError> for Error
Source§fn from(err: ListDiscoveredResourcesError) -> Self
fn from(err: ListDiscoveredResourcesError) -> Self
Source§impl From<ListMigrationTaskUpdatesError> for Error
impl From<ListMigrationTaskUpdatesError> for Error
Source§fn from(err: ListMigrationTaskUpdatesError) -> Self
fn from(err: ListMigrationTaskUpdatesError) -> Self
Source§impl From<ListMigrationTasksError> for Error
impl From<ListMigrationTasksError> for Error
Source§fn from(err: ListMigrationTasksError) -> Self
fn from(err: ListMigrationTasksError) -> Self
Source§impl From<ListProgressUpdateStreamsError> for Error
impl From<ListProgressUpdateStreamsError> for Error
Source§fn from(err: ListProgressUpdateStreamsError) -> Self
fn from(err: ListProgressUpdateStreamsError) -> Self
Source§impl From<ListSourceResourcesError> for Error
impl From<ListSourceResourcesError> for Error
Source§fn from(err: ListSourceResourcesError) -> Self
fn from(err: ListSourceResourcesError) -> Self
Source§impl From<NotifyApplicationStateError> for Error
impl From<NotifyApplicationStateError> for Error
Source§fn from(err: NotifyApplicationStateError) -> Self
fn from(err: NotifyApplicationStateError) -> Self
Source§impl From<NotifyMigrationTaskStateError> for Error
impl From<NotifyMigrationTaskStateError> for Error
Source§fn from(err: NotifyMigrationTaskStateError) -> Self
fn from(err: NotifyMigrationTaskStateError) -> Self
Source§impl From<PutResourceAttributesError> for Error
impl From<PutResourceAttributesError> for Error
Source§fn from(err: PutResourceAttributesError) -> Self
fn from(err: PutResourceAttributesError) -> Self
Source§impl<R> From<SdkError<AssociateCreatedArtifactError, R>> for Error
impl<R> From<SdkError<AssociateCreatedArtifactError, R>> for Error
Source§fn from(err: SdkError<AssociateCreatedArtifactError, R>) -> Self
fn from(err: SdkError<AssociateCreatedArtifactError, R>) -> Self
Source§impl<R> From<SdkError<AssociateDiscoveredResourceError, R>> for Error
impl<R> From<SdkError<AssociateDiscoveredResourceError, R>> for Error
Source§fn from(err: SdkError<AssociateDiscoveredResourceError, R>) -> Self
fn from(err: SdkError<AssociateDiscoveredResourceError, R>) -> Self
Source§impl<R> From<SdkError<AssociateSourceResourceError, R>> for Error
impl<R> From<SdkError<AssociateSourceResourceError, R>> for Error
Source§fn from(err: SdkError<AssociateSourceResourceError, R>) -> Self
fn from(err: SdkError<AssociateSourceResourceError, R>) -> Self
Source§impl<R> From<SdkError<CreateProgressUpdateStreamError, R>> for Error
impl<R> From<SdkError<CreateProgressUpdateStreamError, R>> for Error
Source§fn from(err: SdkError<CreateProgressUpdateStreamError, R>) -> Self
fn from(err: SdkError<CreateProgressUpdateStreamError, R>) -> Self
Source§impl<R> From<SdkError<DeleteProgressUpdateStreamError, R>> for Error
impl<R> From<SdkError<DeleteProgressUpdateStreamError, R>> for Error
Source§fn from(err: SdkError<DeleteProgressUpdateStreamError, R>) -> Self
fn from(err: SdkError<DeleteProgressUpdateStreamError, R>) -> Self
Source§impl<R> From<SdkError<DescribeApplicationStateError, R>> for Error
impl<R> From<SdkError<DescribeApplicationStateError, R>> for Error
Source§fn from(err: SdkError<DescribeApplicationStateError, R>) -> Self
fn from(err: SdkError<DescribeApplicationStateError, R>) -> Self
Source§impl<R> From<SdkError<DescribeMigrationTaskError, R>> for Error
impl<R> From<SdkError<DescribeMigrationTaskError, R>> for Error
Source§fn from(err: SdkError<DescribeMigrationTaskError, R>) -> Self
fn from(err: SdkError<DescribeMigrationTaskError, R>) -> Self
Source§impl<R> From<SdkError<DisassociateCreatedArtifactError, R>> for Error
impl<R> From<SdkError<DisassociateCreatedArtifactError, R>> for Error
Source§fn from(err: SdkError<DisassociateCreatedArtifactError, R>) -> Self
fn from(err: SdkError<DisassociateCreatedArtifactError, R>) -> Self
Source§impl<R> From<SdkError<DisassociateDiscoveredResourceError, R>> for Error
impl<R> From<SdkError<DisassociateDiscoveredResourceError, R>> for Error
Source§fn from(err: SdkError<DisassociateDiscoveredResourceError, R>) -> Self
fn from(err: SdkError<DisassociateDiscoveredResourceError, R>) -> Self
Source§impl<R> From<SdkError<DisassociateSourceResourceError, R>> for Error
impl<R> From<SdkError<DisassociateSourceResourceError, R>> for Error
Source§fn from(err: SdkError<DisassociateSourceResourceError, R>) -> Self
fn from(err: SdkError<DisassociateSourceResourceError, R>) -> Self
Source§impl<R> From<SdkError<ImportMigrationTaskError, R>> for Error
impl<R> From<SdkError<ImportMigrationTaskError, R>> for Error
Source§fn from(err: SdkError<ImportMigrationTaskError, R>) -> Self
fn from(err: SdkError<ImportMigrationTaskError, R>) -> Self
Source§impl<R> From<SdkError<ListApplicationStatesError, R>> for Error
impl<R> From<SdkError<ListApplicationStatesError, R>> for Error
Source§fn from(err: SdkError<ListApplicationStatesError, R>) -> Self
fn from(err: SdkError<ListApplicationStatesError, R>) -> Self
Source§impl<R> From<SdkError<ListCreatedArtifactsError, R>> for Error
impl<R> From<SdkError<ListCreatedArtifactsError, R>> for Error
Source§fn from(err: SdkError<ListCreatedArtifactsError, R>) -> Self
fn from(err: SdkError<ListCreatedArtifactsError, R>) -> Self
Source§impl<R> From<SdkError<ListDiscoveredResourcesError, R>> for Error
impl<R> From<SdkError<ListDiscoveredResourcesError, R>> for Error
Source§fn from(err: SdkError<ListDiscoveredResourcesError, R>) -> Self
fn from(err: SdkError<ListDiscoveredResourcesError, R>) -> Self
Source§impl<R> From<SdkError<ListMigrationTaskUpdatesError, R>> for Error
impl<R> From<SdkError<ListMigrationTaskUpdatesError, R>> for Error
Source§fn from(err: SdkError<ListMigrationTaskUpdatesError, R>) -> Self
fn from(err: SdkError<ListMigrationTaskUpdatesError, R>) -> Self
Source§impl<R> From<SdkError<ListMigrationTasksError, R>> for Error
impl<R> From<SdkError<ListMigrationTasksError, R>> for Error
Source§fn from(err: SdkError<ListMigrationTasksError, R>) -> Self
fn from(err: SdkError<ListMigrationTasksError, R>) -> Self
Source§impl<R> From<SdkError<ListProgressUpdateStreamsError, R>> for Error
impl<R> From<SdkError<ListProgressUpdateStreamsError, R>> for Error
Source§fn from(err: SdkError<ListProgressUpdateStreamsError, R>) -> Self
fn from(err: SdkError<ListProgressUpdateStreamsError, R>) -> Self
Source§impl<R> From<SdkError<ListSourceResourcesError, R>> for Error
impl<R> From<SdkError<ListSourceResourcesError, R>> for Error
Source§fn from(err: SdkError<ListSourceResourcesError, R>) -> Self
fn from(err: SdkError<ListSourceResourcesError, R>) -> Self
Source§impl<R> From<SdkError<NotifyApplicationStateError, R>> for Error
impl<R> From<SdkError<NotifyApplicationStateError, R>> for Error
Source§fn from(err: SdkError<NotifyApplicationStateError, R>) -> Self
fn from(err: SdkError<NotifyApplicationStateError, R>) -> Self
Source§impl<R> From<SdkError<NotifyMigrationTaskStateError, R>> for Error
impl<R> From<SdkError<NotifyMigrationTaskStateError, R>> for Error
Source§fn from(err: SdkError<NotifyMigrationTaskStateError, R>) -> Self
fn from(err: SdkError<NotifyMigrationTaskStateError, R>) -> Self
Source§impl<R> From<SdkError<PutResourceAttributesError, R>> for Error
impl<R> From<SdkError<PutResourceAttributesError, R>> for Error
Source§fn from(err: SdkError<PutResourceAttributesError, R>) -> Self
fn from(err: SdkError<PutResourceAttributesError, R>) -> 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);