#[non_exhaustive]pub struct CreateCacheSubnetGroupError {
pub kind: CreateCacheSubnetGroupErrorKind,
/* private fields */
}
Expand description
Error type for the CreateCacheSubnetGroup
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: CreateCacheSubnetGroupErrorKind
Kind of error that occurred.
Implementations§
source§impl CreateCacheSubnetGroupError
impl CreateCacheSubnetGroupError
sourcepub fn new(kind: CreateCacheSubnetGroupErrorKind, meta: Error) -> Self
pub fn new(kind: CreateCacheSubnetGroupErrorKind, meta: Error) -> Self
Creates a new CreateCacheSubnetGroupError
.
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 CreateCacheSubnetGroupError::Unhandled
variant from any error type.
Examples found in repository?
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442
pub fn parse_create_cache_subnet_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateCacheSubnetGroupOutput,
crate::error::CreateCacheSubnetGroupError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::CreateCacheSubnetGroupError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CacheSubnetGroupAlreadyExists" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::CacheSubnetGroupAlreadyExistsFault(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cache_subnet_group_already_exists_fault::Builder::default(
);
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_subnet_group_already_exists_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"CacheSubnetGroupQuotaExceeded" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::CacheSubnetGroupQuotaExceededFault(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cache_subnet_group_quota_exceeded_fault::Builder::default(
);
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_subnet_group_quota_exceeded_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"CacheSubnetQuotaExceededFault" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::CacheSubnetQuotaExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cache_subnet_quota_exceeded_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_subnet_quota_exceeded_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidSubnet" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::InvalidSubnet({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_subnet::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_subnet_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetNotAllowedFault" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::SubnetNotAllowedFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_not_allowed_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_subnet_not_allowed_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TagQuotaPerResourceExceeded" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::TagQuotaPerResourceExceeded({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::tag_quota_per_resource_exceeded::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_tag_quota_per_resource_exceeded_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateCacheSubnetGroupError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the CreateCacheSubnetGroupError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442
pub fn parse_create_cache_subnet_group_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::CreateCacheSubnetGroupOutput,
crate::error::CreateCacheSubnetGroupError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::CreateCacheSubnetGroupError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CacheSubnetGroupAlreadyExists" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::CacheSubnetGroupAlreadyExistsFault(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cache_subnet_group_already_exists_fault::Builder::default(
);
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_subnet_group_already_exists_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"CacheSubnetGroupQuotaExceeded" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::CacheSubnetGroupQuotaExceededFault(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cache_subnet_group_quota_exceeded_fault::Builder::default(
);
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_subnet_group_quota_exceeded_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"CacheSubnetQuotaExceededFault" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::CacheSubnetQuotaExceededFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::cache_subnet_quota_exceeded_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_cache_subnet_quota_exceeded_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidSubnet" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::InvalidSubnet({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_subnet::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_subnet_xml_err(
response.body().as_ref(),
output,
)
.map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubnetNotAllowedFault" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::SubnetNotAllowedFault({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::subnet_not_allowed_fault::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_subnet_not_allowed_fault_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TagQuotaPerResourceExceeded" => crate::error::CreateCacheSubnetGroupError {
meta: generic,
kind: crate::error::CreateCacheSubnetGroupErrorKind::TagQuotaPerResourceExceeded({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::tag_quota_per_resource_exceeded::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_tag_quota_per_resource_exceeded_xml_err(response.body().as_ref(), output).map_err(crate::error::CreateCacheSubnetGroupError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::CreateCacheSubnetGroupError::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_cache_subnet_group_already_exists_fault(&self) -> bool
pub fn is_cache_subnet_group_already_exists_fault(&self) -> bool
Returns true
if the error kind is CreateCacheSubnetGroupErrorKind::CacheSubnetGroupAlreadyExistsFault
.
sourcepub fn is_cache_subnet_group_quota_exceeded_fault(&self) -> bool
pub fn is_cache_subnet_group_quota_exceeded_fault(&self) -> bool
Returns true
if the error kind is CreateCacheSubnetGroupErrorKind::CacheSubnetGroupQuotaExceededFault
.
sourcepub fn is_cache_subnet_quota_exceeded_fault(&self) -> bool
pub fn is_cache_subnet_quota_exceeded_fault(&self) -> bool
Returns true
if the error kind is CreateCacheSubnetGroupErrorKind::CacheSubnetQuotaExceededFault
.
sourcepub fn is_invalid_subnet(&self) -> bool
pub fn is_invalid_subnet(&self) -> bool
Returns true
if the error kind is CreateCacheSubnetGroupErrorKind::InvalidSubnet
.
sourcepub fn is_subnet_not_allowed_fault(&self) -> bool
pub fn is_subnet_not_allowed_fault(&self) -> bool
Returns true
if the error kind is CreateCacheSubnetGroupErrorKind::SubnetNotAllowedFault
.
sourcepub fn is_tag_quota_per_resource_exceeded(&self) -> bool
pub fn is_tag_quota_per_resource_exceeded(&self) -> bool
Returns true
if the error kind is CreateCacheSubnetGroupErrorKind::TagQuotaPerResourceExceeded
.