#[non_exhaustive]pub struct ListThingRegistrationTaskReportsError {
pub kind: ListThingRegistrationTaskReportsErrorKind,
/* private fields */
}
Expand description
Error type for the ListThingRegistrationTaskReports
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: ListThingRegistrationTaskReportsErrorKind
Kind of error that occurred.
Implementations§
source§impl ListThingRegistrationTaskReportsError
impl ListThingRegistrationTaskReportsError
sourcepub fn new(kind: ListThingRegistrationTaskReportsErrorKind, meta: Error) -> Self
pub fn new(kind: ListThingRegistrationTaskReportsErrorKind, meta: Error) -> Self
Creates a new ListThingRegistrationTaskReportsError
.
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 ListThingRegistrationTaskReportsError::Unhandled
variant from any error type.
Examples found in repository?
22208 22209 22210 22211 22212 22213 22214 22215 22216 22217 22218 22219 22220 22221 22222 22223 22224 22225 22226 22227 22228 22229 22230 22231 22232 22233 22234 22235 22236 22237 22238 22239 22240 22241 22242 22243 22244 22245 22246 22247 22248 22249 22250 22251 22252 22253 22254 22255 22256 22257 22258 22259 22260 22261 22262 22263 22264 22265 22266 22267 22268 22269 22270 22271 22272 22273 22274 22275 22276 22277 22278 22279 22280 22281 22282 22283 22284 22285 22286 22287 22288 22289 22290 22291 22292 22293 22294 22295 22296 22297 22298 22299 22300 22301
pub fn parse_list_thing_registration_task_reports_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListThingRegistrationTaskReportsOutput,
crate::error::ListThingRegistrationTaskReportsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListThingRegistrationTaskReportsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListThingRegistrationTaskReportsError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::ListThingRegistrationTaskReportsError {
meta: generic,
kind: crate::error::ListThingRegistrationTaskReportsErrorKind::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::ListThingRegistrationTaskReportsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::ListThingRegistrationTaskReportsError {
meta: generic,
kind: crate::error::ListThingRegistrationTaskReportsErrorKind::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::ListThingRegistrationTaskReportsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ThrottlingException" => crate::error::ListThingRegistrationTaskReportsError {
meta: generic,
kind: crate::error::ListThingRegistrationTaskReportsErrorKind::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::ListThingRegistrationTaskReportsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::ListThingRegistrationTaskReportsError {
meta: generic,
kind: crate::error::ListThingRegistrationTaskReportsErrorKind::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::ListThingRegistrationTaskReportsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListThingRegistrationTaskReportsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListThingRegistrationTaskReportsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
22208 22209 22210 22211 22212 22213 22214 22215 22216 22217 22218 22219 22220 22221 22222 22223 22224 22225 22226 22227 22228 22229 22230 22231 22232 22233 22234 22235 22236 22237 22238 22239 22240 22241 22242 22243 22244 22245 22246 22247 22248 22249 22250 22251 22252 22253 22254 22255 22256 22257 22258 22259 22260 22261 22262 22263 22264 22265 22266 22267 22268 22269 22270 22271 22272 22273 22274 22275 22276 22277 22278 22279 22280 22281 22282 22283 22284 22285 22286 22287 22288 22289 22290 22291 22292 22293 22294 22295 22296 22297 22298 22299 22300 22301
pub fn parse_list_thing_registration_task_reports_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListThingRegistrationTaskReportsOutput,
crate::error::ListThingRegistrationTaskReportsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListThingRegistrationTaskReportsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ListThingRegistrationTaskReportsError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::ListThingRegistrationTaskReportsError {
meta: generic,
kind: crate::error::ListThingRegistrationTaskReportsErrorKind::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::ListThingRegistrationTaskReportsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::ListThingRegistrationTaskReportsError {
meta: generic,
kind: crate::error::ListThingRegistrationTaskReportsErrorKind::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::ListThingRegistrationTaskReportsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ThrottlingException" => crate::error::ListThingRegistrationTaskReportsError {
meta: generic,
kind: crate::error::ListThingRegistrationTaskReportsErrorKind::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::ListThingRegistrationTaskReportsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::ListThingRegistrationTaskReportsError {
meta: generic,
kind: crate::error::ListThingRegistrationTaskReportsErrorKind::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::ListThingRegistrationTaskReportsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListThingRegistrationTaskReportsError::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 ListThingRegistrationTaskReportsErrorKind::InternalFailureException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is ListThingRegistrationTaskReportsErrorKind::InvalidRequestException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is ListThingRegistrationTaskReportsErrorKind::ThrottlingException
.
Returns true
if the error kind is ListThingRegistrationTaskReportsErrorKind::UnauthorizedException
.