Struct aws_sdk_appstream::error::StopImageBuilderError
source · #[non_exhaustive]pub struct StopImageBuilderError {
pub kind: StopImageBuilderErrorKind,
/* private fields */
}
Expand description
Error type for the StopImageBuilder
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: StopImageBuilderErrorKind
Kind of error that occurred.
Implementations§
source§impl StopImageBuilderError
impl StopImageBuilderError
sourcepub fn new(kind: StopImageBuilderErrorKind, meta: Error) -> Self
pub fn new(kind: StopImageBuilderErrorKind, meta: Error) -> Self
Creates a new StopImageBuilderError
.
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 StopImageBuilderError::Unhandled
variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 5157)
5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217
pub fn parse_stop_image_builder_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::StopImageBuilderOutput, crate::error::StopImageBuilderError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopImageBuilderError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::StopImageBuilderError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConcurrentModificationException" => crate::error::StopImageBuilderError {
meta: generic,
kind: crate::error::StopImageBuilderErrorKind::ConcurrentModificationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::concurrent_modification_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_concurrent_modification_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopImageBuilderError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OperationNotPermittedException" => crate::error::StopImageBuilderError {
meta: generic,
kind: crate::error::StopImageBuilderErrorKind::OperationNotPermittedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::operation_not_permitted_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_operation_not_permitted_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopImageBuilderError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::StopImageBuilderError {
meta: generic,
kind: crate::error::StopImageBuilderErrorKind::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::StopImageBuilderError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StopImageBuilderError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StopImageBuilderError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
src/operation_deser.rs (line 5215)
5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217
pub fn parse_stop_image_builder_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::StopImageBuilderOutput, crate::error::StopImageBuilderError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopImageBuilderError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::StopImageBuilderError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConcurrentModificationException" => crate::error::StopImageBuilderError {
meta: generic,
kind: crate::error::StopImageBuilderErrorKind::ConcurrentModificationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::concurrent_modification_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_concurrent_modification_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopImageBuilderError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"OperationNotPermittedException" => crate::error::StopImageBuilderError {
meta: generic,
kind: crate::error::StopImageBuilderErrorKind::OperationNotPermittedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::operation_not_permitted_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_operation_not_permitted_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopImageBuilderError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::StopImageBuilderError {
meta: generic,
kind: crate::error::StopImageBuilderErrorKind::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::StopImageBuilderError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::StopImageBuilderError::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_concurrent_modification_exception(&self) -> bool
pub fn is_concurrent_modification_exception(&self) -> bool
Returns true
if the error kind is StopImageBuilderErrorKind::ConcurrentModificationException
.
sourcepub fn is_operation_not_permitted_exception(&self) -> bool
pub fn is_operation_not_permitted_exception(&self) -> bool
Returns true
if the error kind is StopImageBuilderErrorKind::OperationNotPermittedException
.
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 StopImageBuilderErrorKind::ResourceNotFoundException
.
Trait Implementations§
source§impl Debug for StopImageBuilderError
impl Debug for StopImageBuilderError
source§impl Display for StopImageBuilderError
impl Display for StopImageBuilderError
source§impl Error for StopImageBuilderError
impl Error for StopImageBuilderError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl From<StopImageBuilderError> for Error
impl From<StopImageBuilderError> for Error
source§fn from(err: StopImageBuilderError) -> Self
fn from(err: StopImageBuilderError) -> Self
Converts to this type from the input type.