#[non_exhaustive]pub struct ListNetworkSettingsError {
pub kind: ListNetworkSettingsErrorKind,
/* private fields */
}
Expand description
Error type for the ListNetworkSettings
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: ListNetworkSettingsErrorKind
Kind of error that occurred.
Implementations§
source§impl ListNetworkSettingsError
impl ListNetworkSettingsError
sourcepub fn new(kind: ListNetworkSettingsErrorKind, meta: Error) -> Self
pub fn new(kind: ListNetworkSettingsErrorKind, meta: Error) -> Self
Creates a new ListNetworkSettingsError
.
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 ListNetworkSettingsError::Unhandled
variant from any error type.
Examples found in repository?
4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246
pub fn parse_list_network_settings_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListNetworkSettingsOutput,
crate::error::ListNetworkSettingsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListNetworkSettingsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListNetworkSettingsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::ListNetworkSettingsError {
meta: generic,
kind: crate::error::ListNetworkSettingsErrorKind::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::ListNetworkSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::ListNetworkSettingsError {
meta: generic,
kind: crate::error::ListNetworkSettingsErrorKind::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::ListNetworkSettingsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_network_settings_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListNetworkSettingsError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::ListNetworkSettingsError {
meta: generic,
kind: crate::error::ListNetworkSettingsErrorKind::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::ListNetworkSettingsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_network_settings_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListNetworkSettingsError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::ListNetworkSettingsError {
meta: generic,
kind: crate::error::ListNetworkSettingsErrorKind::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::ListNetworkSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListNetworkSettingsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ListNetworkSettingsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246
pub fn parse_list_network_settings_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ListNetworkSettingsOutput,
crate::error::ListNetworkSettingsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ListNetworkSettingsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::ListNetworkSettingsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::ListNetworkSettingsError {
meta: generic,
kind: crate::error::ListNetworkSettingsErrorKind::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::ListNetworkSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerException" => crate::error::ListNetworkSettingsError {
meta: generic,
kind: crate::error::ListNetworkSettingsErrorKind::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::ListNetworkSettingsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_network_settings_internal_server_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListNetworkSettingsError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ThrottlingException" => crate::error::ListNetworkSettingsError {
meta: generic,
kind: crate::error::ListNetworkSettingsErrorKind::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::ListNetworkSettingsError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_list_network_settings_throttling_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::ListNetworkSettingsError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ValidationException" => crate::error::ListNetworkSettingsError {
meta: generic,
kind: crate::error::ListNetworkSettingsErrorKind::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::ListNetworkSettingsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ListNetworkSettingsError::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 ListNetworkSettingsErrorKind::AccessDeniedException
.
sourcepub fn is_internal_server_exception(&self) -> bool
pub fn is_internal_server_exception(&self) -> bool
Returns true
if the error kind is ListNetworkSettingsErrorKind::InternalServerException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is ListNetworkSettingsErrorKind::ThrottlingException
.
sourcepub fn is_validation_exception(&self) -> bool
pub fn is_validation_exception(&self) -> bool
Returns true
if the error kind is ListNetworkSettingsErrorKind::ValidationException
.