Struct aws_sdk_networkmanager::error::ListPeeringsError
source · #[non_exhaustive]pub struct ListPeeringsError {
pub kind: ListPeeringsErrorKind,
/* private fields */
}Expand description
Error type for the ListPeerings 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: ListPeeringsErrorKindKind of error that occurred.
Implementations§
source§impl ListPeeringsError
impl ListPeeringsError
sourcepub fn new(kind: ListPeeringsErrorKind, meta: Error) -> Self
pub fn new(kind: ListPeeringsErrorKind, meta: Error) -> Self
Creates a new ListPeeringsError.
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 ListPeeringsError::Unhandled variant from any error type.
Examples found in repository?
src/operation_deser.rs (line 9274)
9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357
pub fn parse_list_peerings_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListPeeringsOutput, crate::error::ListPeeringsError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListPeeringsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListPeeringsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::ListPeeringsError {
meta: generic,
kind: crate::error::ListPeeringsErrorKind::AccessDeniedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListPeeringsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::ListPeeringsError {
meta: generic,
kind: crate::error::ListPeeringsErrorKind::InternalServerException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListPeeringsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_peerings_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListPeeringsError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::ListPeeringsError {
meta: generic,
kind: crate::error::ListPeeringsErrorKind::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::ListPeeringsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_peerings_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListPeeringsError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::ListPeeringsError {
meta: generic,
kind: crate::error::ListPeeringsErrorKind::ValidationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListPeeringsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListPeeringsError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListPeeringsError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
src/operation_deser.rs (line 9355)
9267 9268 9269 9270 9271 9272 9273 9274 9275 9276 9277 9278 9279 9280 9281 9282 9283 9284 9285 9286 9287 9288 9289 9290 9291 9292 9293 9294 9295 9296 9297 9298 9299 9300 9301 9302 9303 9304 9305 9306 9307 9308 9309 9310 9311 9312 9313 9314 9315 9316 9317 9318 9319 9320 9321 9322 9323 9324 9325 9326 9327 9328 9329 9330 9331 9332 9333 9334 9335 9336 9337 9338 9339 9340 9341 9342 9343 9344 9345 9346 9347 9348 9349 9350 9351 9352 9353 9354 9355 9356 9357
pub fn parse_list_peerings_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::ListPeeringsOutput, crate::error::ListPeeringsError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListPeeringsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListPeeringsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::ListPeeringsError {
meta: generic,
kind: crate::error::ListPeeringsErrorKind::AccessDeniedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListPeeringsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::ListPeeringsError {
meta: generic,
kind: crate::error::ListPeeringsErrorKind::InternalServerException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListPeeringsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_peerings_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListPeeringsError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::ListPeeringsError {
meta: generic,
kind: crate::error::ListPeeringsErrorKind::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::ListPeeringsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_peerings_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListPeeringsError::unhandled("Failed to parse RetryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::ListPeeringsError {
meta: generic,
kind: crate::error::ListPeeringsErrorKind::ValidationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ListPeeringsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListPeeringsError::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_access_denied_exception(&self) -> bool
pub fn is_access_denied_exception(&self) -> bool
Returns true if the error kind is ListPeeringsErrorKind::AccessDeniedException.
sourcepub fn is_internal_server_exception(&self) -> bool
pub fn is_internal_server_exception(&self) -> bool
Returns true if the error kind is ListPeeringsErrorKind::InternalServerException.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true if the error kind is ListPeeringsErrorKind::ThrottlingException.
sourcepub fn is_validation_exception(&self) -> bool
pub fn is_validation_exception(&self) -> bool
Returns true if the error kind is ListPeeringsErrorKind::ValidationException.
Trait Implementations§
source§impl Debug for ListPeeringsError
impl Debug for ListPeeringsError
source§impl Display for ListPeeringsError
impl Display for ListPeeringsError
source§impl Error for ListPeeringsError
impl Error for ListPeeringsError
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<ListPeeringsError> for Error
impl From<ListPeeringsError> for Error
source§fn from(err: ListPeeringsError) -> Self
fn from(err: ListPeeringsError) -> Self
Converts to this type from the input type.