#[non_exhaustive]
#[derive(::std::fmt::Debug)]
pub enum Error {
CloudHsmInternalException(crate::types::error::CloudHsmInternalException),
CloudHsmServiceException(crate::types::error::CloudHsmServiceException),
InvalidRequestException(crate::types::error::InvalidRequestException),
#[deprecated(note = "Matching `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`](#impl-ProvideErrorMetadata-for-Error) for what information is available for the error.")]
Unhandled(crate::error::sealed_unhandled::Unhandled),
}
impl ::std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::CloudHsmInternalException(inner) => inner.fmt(f),
Error::CloudHsmServiceException(inner) => inner.fmt(f),
Error::InvalidRequestException(inner) => inner.fmt(f),
Error::Unhandled(_) => {
if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
write!(f, "unhandled error ({code})")
} else {
f.write_str("unhandled error")
}
}
}
}
}
impl From<::aws_smithy_types::error::operation::BuildError> for Error {
fn from(value: ::aws_smithy_types::error::operation::BuildError) -> Self {
Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
source: value.into(),
meta: ::std::default::Default::default(),
})
}
}
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for Error {
fn meta(&self) -> &::aws_smithy_types::error::metadata::ErrorMetadata {
match self {
Self::CloudHsmInternalException(inner) => inner.meta(),
Self::CloudHsmServiceException(inner) => inner.meta(),
Self::InvalidRequestException(inner) => inner.meta(),
Self::Unhandled(inner) => &inner.meta,
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::add_tags_to_resource::AddTagsToResourceError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::add_tags_to_resource::AddTagsToResourceError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::add_tags_to_resource::AddTagsToResourceError> for Error {
fn from(err: crate::operation::add_tags_to_resource::AddTagsToResourceError) -> Self {
match err {
crate::operation::add_tags_to_resource::AddTagsToResourceError::CloudHsmInternalException(inner) => {
Error::CloudHsmInternalException(inner)
}
crate::operation::add_tags_to_resource::AddTagsToResourceError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::add_tags_to_resource::AddTagsToResourceError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::add_tags_to_resource::AddTagsToResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hapg::CreateHapgError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hapg::CreateHapgError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::create_hapg::CreateHapgError> for Error {
fn from(err: crate::operation::create_hapg::CreateHapgError) -> Self {
match err {
crate::operation::create_hapg::CreateHapgError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::create_hapg::CreateHapgError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::create_hapg::CreateHapgError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::create_hapg::CreateHapgError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hsm::CreateHsmError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_hsm::CreateHsmError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::create_hsm::CreateHsmError> for Error {
fn from(err: crate::operation::create_hsm::CreateHsmError) -> Self {
match err {
crate::operation::create_hsm::CreateHsmError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::create_hsm::CreateHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::create_hsm::CreateHsmError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::create_hsm::CreateHsmError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_luna_client::CreateLunaClientError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_luna_client::CreateLunaClientError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::create_luna_client::CreateLunaClientError> for Error {
fn from(err: crate::operation::create_luna_client::CreateLunaClientError) -> Self {
match err {
crate::operation::create_luna_client::CreateLunaClientError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::create_luna_client::CreateLunaClientError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::create_luna_client::CreateLunaClientError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::create_luna_client::CreateLunaClientError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hapg::DeleteHapgError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hapg::DeleteHapgError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::delete_hapg::DeleteHapgError> for Error {
fn from(err: crate::operation::delete_hapg::DeleteHapgError) -> Self {
match err {
crate::operation::delete_hapg::DeleteHapgError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::delete_hapg::DeleteHapgError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::delete_hapg::DeleteHapgError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::delete_hapg::DeleteHapgError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hsm::DeleteHsmError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_hsm::DeleteHsmError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::delete_hsm::DeleteHsmError> for Error {
fn from(err: crate::operation::delete_hsm::DeleteHsmError) -> Self {
match err {
crate::operation::delete_hsm::DeleteHsmError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::delete_hsm::DeleteHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::delete_hsm::DeleteHsmError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::delete_hsm::DeleteHsmError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_luna_client::DeleteLunaClientError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::delete_luna_client::DeleteLunaClientError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::delete_luna_client::DeleteLunaClientError> for Error {
fn from(err: crate::operation::delete_luna_client::DeleteLunaClientError) -> Self {
match err {
crate::operation::delete_luna_client::DeleteLunaClientError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::delete_luna_client::DeleteLunaClientError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::delete_luna_client::DeleteLunaClientError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::delete_luna_client::DeleteLunaClientError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_hapg::DescribeHapgError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_hapg::DescribeHapgError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_hapg::DescribeHapgError> for Error {
fn from(err: crate::operation::describe_hapg::DescribeHapgError) -> Self {
match err {
crate::operation::describe_hapg::DescribeHapgError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::describe_hapg::DescribeHapgError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::describe_hapg::DescribeHapgError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::describe_hapg::DescribeHapgError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_hsm::DescribeHsmError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_hsm::DescribeHsmError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_hsm::DescribeHsmError> for Error {
fn from(err: crate::operation::describe_hsm::DescribeHsmError) -> Self {
match err {
crate::operation::describe_hsm::DescribeHsmError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::describe_hsm::DescribeHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::describe_hsm::DescribeHsmError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::describe_hsm::DescribeHsmError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_luna_client::DescribeLunaClientError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::describe_luna_client::DescribeLunaClientError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::describe_luna_client::DescribeLunaClientError> for Error {
fn from(err: crate::operation::describe_luna_client::DescribeLunaClientError) -> Self {
match err {
crate::operation::describe_luna_client::DescribeLunaClientError::CloudHsmInternalException(inner) => {
Error::CloudHsmInternalException(inner)
}
crate::operation::describe_luna_client::DescribeLunaClientError::CloudHsmServiceException(inner) => {
Error::CloudHsmServiceException(inner)
}
crate::operation::describe_luna_client::DescribeLunaClientError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::describe_luna_client::DescribeLunaClientError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_config::GetConfigError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::get_config::GetConfigError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::get_config::GetConfigError> for Error {
fn from(err: crate::operation::get_config::GetConfigError) -> Self {
match err {
crate::operation::get_config::GetConfigError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::get_config::GetConfigError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::get_config::GetConfigError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::get_config::GetConfigError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_available_zones::ListAvailableZonesError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_available_zones::ListAvailableZonesError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::list_available_zones::ListAvailableZonesError> for Error {
fn from(err: crate::operation::list_available_zones::ListAvailableZonesError) -> Self {
match err {
crate::operation::list_available_zones::ListAvailableZonesError::CloudHsmInternalException(inner) => {
Error::CloudHsmInternalException(inner)
}
crate::operation::list_available_zones::ListAvailableZonesError::CloudHsmServiceException(inner) => {
Error::CloudHsmServiceException(inner)
}
crate::operation::list_available_zones::ListAvailableZonesError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::list_available_zones::ListAvailableZonesError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_hapgs::ListHapgsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_hapgs::ListHapgsError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::list_hapgs::ListHapgsError> for Error {
fn from(err: crate::operation::list_hapgs::ListHapgsError) -> Self {
match err {
crate::operation::list_hapgs::ListHapgsError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::list_hapgs::ListHapgsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::list_hapgs::ListHapgsError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::list_hapgs::ListHapgsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_hsms::ListHsmsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_hsms::ListHsmsError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::list_hsms::ListHsmsError> for Error {
fn from(err: crate::operation::list_hsms::ListHsmsError) -> Self {
match err {
crate::operation::list_hsms::ListHsmsError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::list_hsms::ListHsmsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::list_hsms::ListHsmsError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::list_hsms::ListHsmsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_luna_clients::ListLunaClientsError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_luna_clients::ListLunaClientsError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::list_luna_clients::ListLunaClientsError> for Error {
fn from(err: crate::operation::list_luna_clients::ListLunaClientsError) -> Self {
match err {
crate::operation::list_luna_clients::ListLunaClientsError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::list_luna_clients::ListLunaClientsError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::list_luna_clients::ListLunaClientsError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::list_luna_clients::ListLunaClientsError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::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_runtime_api::client::result::SdkError<crate::operation::list_tags_for_resource::ListTagsForResourceError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
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::CloudHsmInternalException(inner) => {
Error::CloudHsmInternalException(inner)
}
crate::operation::list_tags_for_resource::ListTagsForResourceError::CloudHsmServiceException(inner) => {
Error::CloudHsmServiceException(inner)
}
crate::operation::list_tags_for_resource::ListTagsForResourceError::InvalidRequestException(inner) => {
Error::InvalidRequestException(inner)
}
crate::operation::list_tags_for_resource::ListTagsForResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_hapg::ModifyHapgError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_hapg::ModifyHapgError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::modify_hapg::ModifyHapgError> for Error {
fn from(err: crate::operation::modify_hapg::ModifyHapgError) -> Self {
match err {
crate::operation::modify_hapg::ModifyHapgError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::modify_hapg::ModifyHapgError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::modify_hapg::ModifyHapgError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::modify_hapg::ModifyHapgError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_hsm::ModifyHsmError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_hsm::ModifyHsmError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::modify_hsm::ModifyHsmError> for Error {
fn from(err: crate::operation::modify_hsm::ModifyHsmError) -> Self {
match err {
crate::operation::modify_hsm::ModifyHsmError::CloudHsmInternalException(inner) => Error::CloudHsmInternalException(inner),
crate::operation::modify_hsm::ModifyHsmError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::modify_hsm::ModifyHsmError::InvalidRequestException(inner) => Error::InvalidRequestException(inner),
crate::operation::modify_hsm::ModifyHsmError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_luna_client::ModifyLunaClientError, R>> for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::modify_luna_client::ModifyLunaClientError, R>) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::modify_luna_client::ModifyLunaClientError> for Error {
fn from(err: crate::operation::modify_luna_client::ModifyLunaClientError) -> Self {
match err {
crate::operation::modify_luna_client::ModifyLunaClientError::CloudHsmServiceException(inner) => Error::CloudHsmServiceException(inner),
crate::operation::modify_luna_client::ModifyLunaClientError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl<R> From<::aws_smithy_runtime_api::client::result::SdkError<crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError, R>>
for Error
where
R: Send + Sync + std::fmt::Debug + 'static,
{
fn from(
err: ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError, R>,
) -> Self {
match err {
::aws_smithy_runtime_api::client::result::SdkError::ServiceError(context) => Self::from(context.into_err()),
_ => Error::Unhandled(crate::error::sealed_unhandled::Unhandled {
meta: ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(&err).clone(),
source: err.into(),
}),
}
}
}
impl From<crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError> for Error {
fn from(err: crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError) -> Self {
match err {
crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError::CloudHsmInternalException(inner) => {
Error::CloudHsmInternalException(inner)
}
crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError::CloudHsmServiceException(inner) => {
Error::CloudHsmServiceException(inner)
}
crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError::InvalidRequestException(inner) => {
Error::InvalidRequestException(inner)
}
crate::operation::remove_tags_from_resource::RemoveTagsFromResourceError::Unhandled(inner) => Error::Unhandled(inner),
}
}
}
impl ::std::error::Error for Error {
fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
match self {
Error::CloudHsmInternalException(inner) => inner.source(),
Error::CloudHsmServiceException(inner) => inner.source(),
Error::InvalidRequestException(inner) => inner.source(),
Error::Unhandled(inner) => ::std::option::Option::Some(&*inner.source),
}
}
}
impl ::aws_types::request_id::RequestId for Error {
fn request_id(&self) -> Option<&str> {
match self {
Self::CloudHsmInternalException(e) => e.request_id(),
Self::CloudHsmServiceException(e) => e.request_id(),
Self::InvalidRequestException(e) => e.request_id(),
Self::Unhandled(e) => e.meta.request_id(),
}
}
}