Struct aws_sdk_iot::error::UpdateFleetMetricError
source · #[non_exhaustive]pub struct UpdateFleetMetricError {
pub kind: UpdateFleetMetricErrorKind,
/* private fields */
}Expand description
Error type for the UpdateFleetMetric 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: UpdateFleetMetricErrorKindKind of error that occurred.
Implementations§
source§impl UpdateFleetMetricError
impl UpdateFleetMetricError
sourcepub fn new(kind: UpdateFleetMetricErrorKind, meta: Error) -> Self
pub fn new(kind: UpdateFleetMetricErrorKind, meta: Error) -> Self
Creates a new UpdateFleetMetricError.
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 UpdateFleetMetricError::Unhandled variant from any error type.
Examples found in repository?
28144 28145 28146 28147 28148 28149 28150 28151 28152 28153 28154 28155 28156 28157 28158 28159 28160 28161 28162 28163 28164 28165 28166 28167 28168 28169 28170 28171 28172 28173 28174 28175 28176 28177 28178 28179 28180 28181 28182 28183 28184 28185 28186 28187 28188 28189 28190 28191 28192 28193 28194 28195 28196 28197 28198 28199 28200 28201 28202 28203 28204 28205 28206 28207 28208 28209 28210 28211 28212 28213 28214 28215 28216 28217 28218 28219 28220 28221 28222 28223 28224 28225 28226 28227 28228 28229 28230 28231 28232 28233 28234 28235 28236 28237 28238 28239 28240 28241 28242 28243 28244 28245 28246 28247 28248 28249 28250 28251 28252 28253 28254 28255 28256 28257 28258 28259 28260 28261 28262 28263 28264 28265 28266 28267 28268 28269 28270 28271 28272 28273 28274 28275 28276 28277 28278 28279 28280 28281 28282 28283 28284 28285 28286 28287 28288 28289 28290 28291 28292 28293 28294 28295 28296 28297 28298 28299 28300 28301 28302 28303 28304 28305 28306 28307 28308 28309 28310 28311 28312 28313 28314 28315 28316 28317 28318 28319 28320 28321 28322 28323 28324 28325 28326 28327 28328 28329 28330 28331
pub fn parse_update_fleet_metric_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateFleetMetricOutput, crate::error::UpdateFleetMetricError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateFleetMetricError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateFleetMetricError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"IndexNotReadyException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::IndexNotReadyException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::index_not_ready_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_index_not_ready_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalFailureException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::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::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidAggregationException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::InvalidAggregationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_aggregation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_aggregation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidQueryException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::InvalidQueryException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_query_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_query_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::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::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::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::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::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::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"VersionConflictException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::VersionConflictException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::version_conflict_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_version_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateFleetMetricError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the UpdateFleetMetricError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
28144 28145 28146 28147 28148 28149 28150 28151 28152 28153 28154 28155 28156 28157 28158 28159 28160 28161 28162 28163 28164 28165 28166 28167 28168 28169 28170 28171 28172 28173 28174 28175 28176 28177 28178 28179 28180 28181 28182 28183 28184 28185 28186 28187 28188 28189 28190 28191 28192 28193 28194 28195 28196 28197 28198 28199 28200 28201 28202 28203 28204 28205 28206 28207 28208 28209 28210 28211 28212 28213 28214 28215 28216 28217 28218 28219 28220 28221 28222 28223 28224 28225 28226 28227 28228 28229 28230 28231 28232 28233 28234 28235 28236 28237 28238 28239 28240 28241 28242 28243 28244 28245 28246 28247 28248 28249 28250 28251 28252 28253 28254 28255 28256 28257 28258 28259 28260 28261 28262 28263 28264 28265 28266 28267 28268 28269 28270 28271 28272 28273 28274 28275 28276 28277 28278 28279 28280 28281 28282 28283 28284 28285 28286 28287 28288 28289 28290 28291 28292 28293 28294 28295 28296 28297 28298 28299 28300 28301 28302 28303 28304 28305 28306 28307 28308 28309 28310 28311 28312 28313 28314 28315 28316 28317 28318 28319 28320 28321 28322 28323 28324 28325 28326 28327 28328 28329 28330 28331
pub fn parse_update_fleet_metric_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::UpdateFleetMetricOutput, crate::error::UpdateFleetMetricError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::UpdateFleetMetricError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::UpdateFleetMetricError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"IndexNotReadyException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::IndexNotReadyException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::index_not_ready_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_index_not_ready_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalFailureException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::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::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidAggregationException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::InvalidAggregationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_aggregation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_aggregation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidQueryException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::InvalidQueryException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_query_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_query_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidRequestException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::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::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ResourceNotFoundException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::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::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::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::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"VersionConflictException" => crate::error::UpdateFleetMetricError {
meta: generic,
kind: crate::error::UpdateFleetMetricErrorKind::VersionConflictException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::version_conflict_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_version_conflict_exception_json_err(response.body().as_ref(), output).map_err(crate::error::UpdateFleetMetricError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::UpdateFleetMetricError::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_index_not_ready_exception(&self) -> bool
pub fn is_index_not_ready_exception(&self) -> bool
Returns true if the error kind is UpdateFleetMetricErrorKind::IndexNotReadyException.
sourcepub fn is_internal_failure_exception(&self) -> bool
pub fn is_internal_failure_exception(&self) -> bool
Returns true if the error kind is UpdateFleetMetricErrorKind::InternalFailureException.
sourcepub fn is_invalid_aggregation_exception(&self) -> bool
pub fn is_invalid_aggregation_exception(&self) -> bool
Returns true if the error kind is UpdateFleetMetricErrorKind::InvalidAggregationException.
sourcepub fn is_invalid_query_exception(&self) -> bool
pub fn is_invalid_query_exception(&self) -> bool
Returns true if the error kind is UpdateFleetMetricErrorKind::InvalidQueryException.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true if the error kind is UpdateFleetMetricErrorKind::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 UpdateFleetMetricErrorKind::ResourceNotFoundException.
Returns true if the error kind is UpdateFleetMetricErrorKind::ServiceUnavailableException.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true if the error kind is UpdateFleetMetricErrorKind::ThrottlingException.
Returns true if the error kind is UpdateFleetMetricErrorKind::UnauthorizedException.
sourcepub fn is_version_conflict_exception(&self) -> bool
pub fn is_version_conflict_exception(&self) -> bool
Returns true if the error kind is UpdateFleetMetricErrorKind::VersionConflictException.