#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub enum Error {
InternalFailureException(crate::types::error::InternalFailureException),
InvalidRequestException(crate::types::error::InvalidRequestException),
ResourceConflictException(crate::types::error::ResourceConflictException),
ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
TooManyRequestsException(crate::types::error::TooManyRequestsException),
Unhandled(aws_smithy_types::error::Unhandled),
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::InternalFailureException(inner) => inner.fmt(f),
Error::InvalidRequestException(inner) => inner.fmt(f),
Error::ResourceConflictException(inner) => inner.fmt(f),
Error::ResourceNotFoundException(inner) => inner.fmt(f),
Error::TooManyRequestsException(inner) => inner.fmt(f),
Error::Unhandled(inner) => inner.fmt(f),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::associate_device_with_placement::AssociateDeviceWithPlacementError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::associate_device_with_placement::AssociateDeviceWithPlacementError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::associate_device_with_placement::AssociateDeviceWithPlacementError>
for Error
{
fn from(
err: crate::operation::associate_device_with_placement::AssociateDeviceWithPlacementError,
) -> Self {
match err {
crate::operation::associate_device_with_placement::AssociateDeviceWithPlacementError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::associate_device_with_placement::AssociateDeviceWithPlacementError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::associate_device_with_placement::AssociateDeviceWithPlacementError::ResourceConflictException(inner) => Error::ResourceConflictException(inner),
crate::operation::associate_device_with_placement::AssociateDeviceWithPlacementError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::associate_device_with_placement::AssociateDeviceWithPlacementError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::create_placement::CreatePlacementError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::create_placement::CreatePlacementError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::create_placement::CreatePlacementError> for Error {
fn from(err: crate::operation::create_placement::CreatePlacementError) -> Self {
match err {
crate::operation::create_placement::CreatePlacementError::InternalFailureException(
inner,
) => Error::InternalFailureException(inner),
crate::operation::create_placement::CreatePlacementError::InvalidRequestException(
inner,
) => Error::InvalidRequestException(inner),
crate::operation::create_placement::CreatePlacementError::ResourceConflictException(
inner,
) => Error::ResourceConflictException(inner),
crate::operation::create_placement::CreatePlacementError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::create_placement::CreatePlacementError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<aws_smithy_http::result::SdkError<crate::operation::create_project::CreateProjectError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::create_project::CreateProjectError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::create_project::CreateProjectError> for Error {
fn from(err: crate::operation::create_project::CreateProjectError) -> Self {
match err {
crate::operation::create_project::CreateProjectError::InternalFailureException(
inner,
) => Error::InternalFailureException(inner),
crate::operation::create_project::CreateProjectError::InvalidRequestException(
inner,
) => Error::InvalidRequestException(inner),
crate::operation::create_project::CreateProjectError::ResourceConflictException(
inner,
) => Error::ResourceConflictException(inner),
crate::operation::create_project::CreateProjectError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::delete_placement::DeletePlacementError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::delete_placement::DeletePlacementError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::delete_placement::DeletePlacementError> for Error {
fn from(err: crate::operation::delete_placement::DeletePlacementError) -> Self {
match err {
crate::operation::delete_placement::DeletePlacementError::InternalFailureException(
inner,
) => Error::InternalFailureException(inner),
crate::operation::delete_placement::DeletePlacementError::InvalidRequestException(
inner,
) => Error::InvalidRequestException(inner),
crate::operation::delete_placement::DeletePlacementError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::delete_placement::DeletePlacementError::TooManyRequestsException(
inner,
) => Error::TooManyRequestsException(inner),
crate::operation::delete_placement::DeletePlacementError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<aws_smithy_http::result::SdkError<crate::operation::delete_project::DeleteProjectError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::delete_project::DeleteProjectError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::delete_project::DeleteProjectError> for Error {
fn from(err: crate::operation::delete_project::DeleteProjectError) -> Self {
match err {
crate::operation::delete_project::DeleteProjectError::InternalFailureException(
inner,
) => Error::InternalFailureException(inner),
crate::operation::delete_project::DeleteProjectError::InvalidRequestException(
inner,
) => Error::InvalidRequestException(inner),
crate::operation::delete_project::DeleteProjectError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::delete_project::DeleteProjectError::TooManyRequestsException(
inner,
) => Error::TooManyRequestsException(inner),
crate::operation::delete_project::DeleteProjectError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::describe_placement::DescribePlacementError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::describe_placement::DescribePlacementError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::describe_placement::DescribePlacementError> for Error {
fn from(err: crate::operation::describe_placement::DescribePlacementError) -> Self {
match err {
crate::operation::describe_placement::DescribePlacementError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::describe_placement::DescribePlacementError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::describe_placement::DescribePlacementError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::describe_placement::DescribePlacementError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::describe_project::DescribeProjectError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::describe_project::DescribeProjectError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::describe_project::DescribeProjectError> for Error {
fn from(err: crate::operation::describe_project::DescribeProjectError) -> Self {
match err {
crate::operation::describe_project::DescribeProjectError::InternalFailureException(
inner,
) => Error::InternalFailureException(inner),
crate::operation::describe_project::DescribeProjectError::InvalidRequestException(
inner,
) => Error::InvalidRequestException(inner),
crate::operation::describe_project::DescribeProjectError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::describe_project::DescribeProjectError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::disassociate_device_from_placement::DisassociateDeviceFromPlacementError, R>> for Error where R: Send + Sync + std::fmt::Debug + 'static {
fn from(err: aws_smithy_http::result::SdkError<crate::operation::disassociate_device_from_placement::DisassociateDeviceFromPlacementError, R>) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone())
.source(err)
.build()
),
}
}
}
impl
From<crate::operation::disassociate_device_from_placement::DisassociateDeviceFromPlacementError>
for Error
{
fn from(
err: crate::operation::disassociate_device_from_placement::DisassociateDeviceFromPlacementError,
) -> Self {
match err {
crate::operation::disassociate_device_from_placement::DisassociateDeviceFromPlacementError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::disassociate_device_from_placement::DisassociateDeviceFromPlacementError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::disassociate_device_from_placement::DisassociateDeviceFromPlacementError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::disassociate_device_from_placement::DisassociateDeviceFromPlacementError::TooManyRequestsException(inner) => Error::TooManyRequestsException(inner),
crate::operation::disassociate_device_from_placement::DisassociateDeviceFromPlacementError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::get_devices_in_placement::GetDevicesInPlacementError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::get_devices_in_placement::GetDevicesInPlacementError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::get_devices_in_placement::GetDevicesInPlacementError> for Error {
fn from(err: crate::operation::get_devices_in_placement::GetDevicesInPlacementError) -> Self {
match err {
crate::operation::get_devices_in_placement::GetDevicesInPlacementError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::get_devices_in_placement::GetDevicesInPlacementError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::get_devices_in_placement::GetDevicesInPlacementError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::get_devices_in_placement::GetDevicesInPlacementError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::list_placements::ListPlacementsError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::list_placements::ListPlacementsError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::list_placements::ListPlacementsError> for Error {
fn from(err: crate::operation::list_placements::ListPlacementsError) -> Self {
match err {
crate::operation::list_placements::ListPlacementsError::InternalFailureException(
inner,
) => Error::InternalFailureException(inner),
crate::operation::list_placements::ListPlacementsError::InvalidRequestException(
inner,
) => Error::InvalidRequestException(inner),
crate::operation::list_placements::ListPlacementsError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::list_placements::ListPlacementsError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<aws_smithy_http::result::SdkError<crate::operation::list_projects::ListProjectsError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::list_projects::ListProjectsError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::list_projects::ListProjectsError> for Error {
fn from(err: crate::operation::list_projects::ListProjectsError) -> Self {
match err {
crate::operation::list_projects::ListProjectsError::InternalFailureException(inner) => {
Error::InternalFailureException(inner)
}
crate::operation::list_projects::ListProjectsError::InvalidRequestException(inner) => {
Error::InvalidRequestException(inner)
}
crate::operation::list_projects::ListProjectsError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::list_tags_for_resource::ListTagsForResourceError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::list_tags_for_resource::ListTagsForResourceError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::list_tags_for_resource::ListTagsForResourceError> for Error {
fn from(err: crate::operation::list_tags_for_resource::ListTagsForResourceError) -> Self {
match err {
crate::operation::list_tags_for_resource::ListTagsForResourceError::InternalFailureException(inner) => Error::InternalFailureException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::ResourceNotFoundException(inner) => Error::ResourceNotFoundException(inner),
crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<aws_smithy_http::result::SdkError<crate::operation::tag_resource::TagResourceError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<crate::operation::tag_resource::TagResourceError, R>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::tag_resource::TagResourceError> for Error {
fn from(err: crate::operation::tag_resource::TagResourceError) -> Self {
match err {
crate::operation::tag_resource::TagResourceError::InternalFailureException(inner) => {
Error::InternalFailureException(inner)
}
crate::operation::tag_resource::TagResourceError::InvalidRequestException(inner) => {
Error::InvalidRequestException(inner)
}
crate::operation::tag_resource::TagResourceError::ResourceNotFoundException(inner) => {
Error::ResourceNotFoundException(inner)
}
crate::operation::tag_resource::TagResourceError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<aws_smithy_http::result::SdkError<crate::operation::untag_resource::UntagResourceError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::untag_resource::UntagResourceError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::untag_resource::UntagResourceError> for Error {
fn from(err: crate::operation::untag_resource::UntagResourceError) -> Self {
match err {
crate::operation::untag_resource::UntagResourceError::InternalFailureException(
inner,
) => Error::InternalFailureException(inner),
crate::operation::untag_resource::UntagResourceError::InvalidRequestException(
inner,
) => Error::InvalidRequestException(inner),
crate::operation::untag_resource::UntagResourceError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::untag_resource::UntagResourceError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<
aws_smithy_http::result::SdkError<
crate::operation::update_placement::UpdatePlacementError,
R,
>,
> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::update_placement::UpdatePlacementError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::update_placement::UpdatePlacementError> for Error {
fn from(err: crate::operation::update_placement::UpdatePlacementError) -> Self {
match err {
crate::operation::update_placement::UpdatePlacementError::InternalFailureException(
inner,
) => Error::InternalFailureException(inner),
crate::operation::update_placement::UpdatePlacementError::InvalidRequestException(
inner,
) => Error::InvalidRequestException(inner),
crate::operation::update_placement::UpdatePlacementError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::update_placement::UpdatePlacementError::TooManyRequestsException(
inner,
) => Error::TooManyRequestsException(inner),
crate::operation::update_placement::UpdatePlacementError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl<R>
From<aws_smithy_http::result::SdkError<crate::operation::update_project::UpdateProjectError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: aws_smithy_http::result::SdkError<
crate::operation::update_project::UpdateProjectError,
R,
>,
) -> Self {
match err {
aws_smithy_http::result::SdkError::ServiceError(context) => {
Self::from(context.into_err())
}
_ => Error::Unhandled(
aws_smithy_types::error::Unhandled::builder()
.meta(
aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
)
.source(err)
.build(),
),
}
}
}
impl From<crate::operation::update_project::UpdateProjectError> for Error {
fn from(err: crate::operation::update_project::UpdateProjectError) -> Self {
match err {
crate::operation::update_project::UpdateProjectError::InternalFailureException(
inner,
) => Error::InternalFailureException(inner),
crate::operation::update_project::UpdateProjectError::InvalidRequestException(
inner,
) => Error::InvalidRequestException(inner),
crate::operation::update_project::UpdateProjectError::ResourceNotFoundException(
inner,
) => Error::ResourceNotFoundException(inner),
crate::operation::update_project::UpdateProjectError::TooManyRequestsException(
inner,
) => Error::TooManyRequestsException(inner),
crate::operation::update_project::UpdateProjectError::Unhandled(inner) => {
Error::Unhandled(inner)
}
}
}
}
impl std::error::Error for Error {}
impl aws_http::request_id::RequestId for Error {
fn request_id(&self) -> Option<&str> {
match self {
Self::InternalFailureException(e) => e.request_id(),
Self::InvalidRequestException(e) => e.request_id(),
Self::ResourceConflictException(e) => e.request_id(),
Self::ResourceNotFoundException(e) => e.request_id(),
Self::TooManyRequestsException(e) => e.request_id(),
Self::Unhandled(e) => e.request_id(),
}
}
}