#[non_exhaustive]pub struct GetBehaviorModelTrainingSummariesError {
pub kind: GetBehaviorModelTrainingSummariesErrorKind,
/* private fields */
}
Expand description
Error type for the GetBehaviorModelTrainingSummaries
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: GetBehaviorModelTrainingSummariesErrorKind
Kind of error that occurred.
Implementations§
source§impl GetBehaviorModelTrainingSummariesError
impl GetBehaviorModelTrainingSummariesError
sourcepub fn new(kind: GetBehaviorModelTrainingSummariesErrorKind, meta: Error) -> Self
pub fn new(kind: GetBehaviorModelTrainingSummariesErrorKind, meta: Error) -> Self
Creates a new GetBehaviorModelTrainingSummariesError
.
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 GetBehaviorModelTrainingSummariesError::Unhandled
variant from any error type.
Examples found in repository?
14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844
pub fn parse_get_behavior_model_training_summaries_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetBehaviorModelTrainingSummariesOutput,
crate::error::GetBehaviorModelTrainingSummariesError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::GetBehaviorModelTrainingSummariesError {
meta: generic,
kind:
crate::error::GetBehaviorModelTrainingSummariesErrorKind::InternalFailureException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::internal_failure_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::GetBehaviorModelTrainingSummariesError {
meta: generic,
kind: crate::error::GetBehaviorModelTrainingSummariesErrorKind::InvalidRequestException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ResourceNotFoundException" => crate::error::GetBehaviorModelTrainingSummariesError {
meta: generic,
kind:
crate::error::GetBehaviorModelTrainingSummariesErrorKind::ResourceNotFoundException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ThrottlingException" => crate::error::GetBehaviorModelTrainingSummariesError {
meta: generic,
kind: crate::error::GetBehaviorModelTrainingSummariesErrorKind::ThrottlingException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetBehaviorModelTrainingSummariesError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetBehaviorModelTrainingSummariesError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
14746 14747 14748 14749 14750 14751 14752 14753 14754 14755 14756 14757 14758 14759 14760 14761 14762 14763 14764 14765 14766 14767 14768 14769 14770 14771 14772 14773 14774 14775 14776 14777 14778 14779 14780 14781 14782 14783 14784 14785 14786 14787 14788 14789 14790 14791 14792 14793 14794 14795 14796 14797 14798 14799 14800 14801 14802 14803 14804 14805 14806 14807 14808 14809 14810 14811 14812 14813 14814 14815 14816 14817 14818 14819 14820 14821 14822 14823 14824 14825 14826 14827 14828 14829 14830 14831 14832 14833 14834 14835 14836 14837 14838 14839 14840 14841 14842 14843 14844
pub fn parse_get_behavior_model_training_summaries_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetBehaviorModelTrainingSummariesOutput,
crate::error::GetBehaviorModelTrainingSummariesError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::GetBehaviorModelTrainingSummariesError {
meta: generic,
kind:
crate::error::GetBehaviorModelTrainingSummariesErrorKind::InternalFailureException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::internal_failure_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::GetBehaviorModelTrainingSummariesError {
meta: generic,
kind: crate::error::GetBehaviorModelTrainingSummariesErrorKind::InvalidRequestException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ResourceNotFoundException" => crate::error::GetBehaviorModelTrainingSummariesError {
meta: generic,
kind:
crate::error::GetBehaviorModelTrainingSummariesErrorKind::ResourceNotFoundException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ThrottlingException" => crate::error::GetBehaviorModelTrainingSummariesError {
meta: generic,
kind: crate::error::GetBehaviorModelTrainingSummariesErrorKind::ThrottlingException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetBehaviorModelTrainingSummariesError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetBehaviorModelTrainingSummariesError::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_internal_failure_exception(&self) -> bool
pub fn is_internal_failure_exception(&self) -> bool
Returns true
if the error kind is GetBehaviorModelTrainingSummariesErrorKind::InternalFailureException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is GetBehaviorModelTrainingSummariesErrorKind::InvalidRequestException
.
sourcepub fn is_resource_not_found_exception(&self) -> bool
pub fn is_resource_not_found_exception(&self) -> bool
Returns true
if the error kind is GetBehaviorModelTrainingSummariesErrorKind::ResourceNotFoundException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is GetBehaviorModelTrainingSummariesErrorKind::ThrottlingException
.