fix(client_error): Handle errors (#2308)

This commit is contained in:
Pepe Fagoaga
2023-05-04 11:06:24 +02:00
committed by GitHub
parent 820f18da4d
commit 8503c6a64d
4 changed files with 4 additions and 4 deletions

View File

@@ -81,7 +81,7 @@ class CloudFormation:
stack.is_nested_stack = True if stack.root_nested_stack != "" else False
except ClientError as error:
if error.response["Error"]["Code"] != "ValidationError":
if error.response["Error"]["Code"] == "ValidationError":
logger.warning(
f"{stack.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)

View File

@@ -177,7 +177,7 @@ class DAX:
cluster.tags = response
except ClientError as error:
if error.response["Error"]["Code"] != "InvalidARNFault":
if error.response["Error"]["Code"] == "InvalidARNFault":
logger.warning(
f"{regional_client.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)

View File

@@ -119,7 +119,7 @@ class IAM:
credential_list = list(csv_reader)
except ClientError as error:
if error.response["Error"]["Code"] != "LimitExceededException":
if error.response["Error"]["Code"] == "LimitExceededException":
logger.warning(
f"{self.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)

View File

@@ -150,7 +150,7 @@ class RDS:
if "all" in att["AttributeValues"]:
snapshot.public = True
except ClientError as error:
if error.response["Error"]["Code"] != "DBSnapshotNotFound":
if error.response["Error"]["Code"] == "DBSnapshotNotFound":
logger.warning(
f"{regional_client.region} -- {error.__class__.__name__}[{error.__traceback__.tb_lineno}]: {error}"
)