Struct aws_sdk_kms::error::ConnectCustomKeyStoreError
source · #[non_exhaustive]pub struct ConnectCustomKeyStoreError {
pub kind: ConnectCustomKeyStoreErrorKind,
/* private fields */
}
Expand description
Error type for the ConnectCustomKeyStore
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: ConnectCustomKeyStoreErrorKind
Kind of error that occurred.
Implementations§
source§impl ConnectCustomKeyStoreError
impl ConnectCustomKeyStoreError
sourcepub fn new(kind: ConnectCustomKeyStoreErrorKind, meta: Error) -> Self
pub fn new(kind: ConnectCustomKeyStoreErrorKind, meta: Error) -> Self
Creates a new ConnectCustomKeyStoreError
.
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the ConnectCustomKeyStoreError::Unhandled
variant from any error type.
Examples found in repository?
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
pub fn parse_connect_custom_key_store_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ConnectCustomKeyStoreOutput,
crate::error::ConnectCustomKeyStoreError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ConnectCustomKeyStoreError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CloudHsmClusterInvalidConfigurationException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::CloudHsmClusterInvalidConfigurationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cloud_hsm_cluster_invalid_configuration_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_cloud_hsm_cluster_invalid_configuration_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"CloudHsmClusterNotActiveException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::CloudHsmClusterNotActiveException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cloud_hsm_cluster_not_active_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_cloud_hsm_cluster_not_active_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"CustomKeyStoreInvalidStateException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::CustomKeyStoreInvalidStateException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::custom_key_store_invalid_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_custom_key_store_invalid_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"CustomKeyStoreNotFoundException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::CustomKeyStoreNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::custom_key_store_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_custom_key_store_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"KMSInternalException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::KmsInternalException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::kms_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::ConnectCustomKeyStoreError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ConnectCustomKeyStoreError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211
pub fn parse_connect_custom_key_store_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ConnectCustomKeyStoreOutput,
crate::error::ConnectCustomKeyStoreError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ConnectCustomKeyStoreError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CloudHsmClusterInvalidConfigurationException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::CloudHsmClusterInvalidConfigurationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cloud_hsm_cluster_invalid_configuration_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_cloud_hsm_cluster_invalid_configuration_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"CloudHsmClusterNotActiveException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::CloudHsmClusterNotActiveException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::cloud_hsm_cluster_not_active_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_cloud_hsm_cluster_not_active_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"CustomKeyStoreInvalidStateException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::CustomKeyStoreInvalidStateException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::custom_key_store_invalid_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_custom_key_store_invalid_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"CustomKeyStoreNotFoundException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::CustomKeyStoreNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::custom_key_store_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_custom_key_store_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"KMSInternalException" => crate::error::ConnectCustomKeyStoreError { meta: generic, kind: crate::error::ConnectCustomKeyStoreErrorKind::KmsInternalException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::kms_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ConnectCustomKeyStoreError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::ConnectCustomKeyStoreError::generic(generic)
})
}
sourcepub fn meta(&self) -> &Error
pub fn meta(&self) -> &Error
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request ID if it’s available.
sourcepub fn is_cloud_hsm_cluster_invalid_configuration_exception(&self) -> bool
pub fn is_cloud_hsm_cluster_invalid_configuration_exception(&self) -> bool
Returns true
if the error kind is ConnectCustomKeyStoreErrorKind::CloudHsmClusterInvalidConfigurationException
.
sourcepub fn is_cloud_hsm_cluster_not_active_exception(&self) -> bool
pub fn is_cloud_hsm_cluster_not_active_exception(&self) -> bool
Returns true
if the error kind is ConnectCustomKeyStoreErrorKind::CloudHsmClusterNotActiveException
.
sourcepub fn is_custom_key_store_invalid_state_exception(&self) -> bool
pub fn is_custom_key_store_invalid_state_exception(&self) -> bool
Returns true
if the error kind is ConnectCustomKeyStoreErrorKind::CustomKeyStoreInvalidStateException
.
sourcepub fn is_custom_key_store_not_found_exception(&self) -> bool
pub fn is_custom_key_store_not_found_exception(&self) -> bool
Returns true
if the error kind is ConnectCustomKeyStoreErrorKind::CustomKeyStoreNotFoundException
.
sourcepub fn is_kms_internal_exception(&self) -> bool
pub fn is_kms_internal_exception(&self) -> bool
Returns true
if the error kind is ConnectCustomKeyStoreErrorKind::KmsInternalException
.