Skip to content

Commit

Permalink
Merge pull request #168 from Skyscanner/downgrade-logger-exception-to…
Browse files Browse the repository at this point in the history
…-warning

Downgrade logging severity from exception to warning when there is no stack in AWS
  • Loading branch information
ocrawford555 committed Mar 30, 2021
2 parents ff730bd + 79c378c commit a4327f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.0.3] - 2021-03-26
### Improvements
- Downgrade logging severity from exception to warning when there is no stack in AWS

## [1.0.2] - 2021-03-25
### Improvements
- Handle AWS throttling errors when listing exports for a given account and region
Expand Down
2 changes: 1 addition & 1 deletion cfripper/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (1, 0, 2)
VERSION = (1, 0, 3)

__version__ = ".".join(map(str, VERSION))
2 changes: 1 addition & 1 deletion cfripper/boto3_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def get_template(self) -> Optional[Dict]:
sleep((i + 1) * 2)
except ClientError as e:
if e.response["Error"]["Code"] == "ValidationError":
logger.exception(f"There is no stack: {self.stack_id} on {self.account_id} - {self.region}")
logger.warning(f"There is no stack: {self.stack_id} on {self.account_id} - {self.region}")
return stack_content
elif e.response["Error"]["Code"] == "Throttling":
logger.warning(f"AWS Throttling: {self.stack_id} on {self.account_id} - {self.region}")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_boto3_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def boto3_client():
[CLIENT_ERROR_VALIDATION],
None,
[call("Stack: stack-id on 123456789 - eu-west-1 get_template Attempt #0")],
[],
[call("There is no stack: stack-id on 123456789 - eu-west-1")],
[],
),
(
[CLIENT_ERROR_THROTTLING, {"A": "a"}],
Expand Down

0 comments on commit a4327f7

Please sign in to comment.