mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-12 08:12:27 -05:00
handle delivery receipts when it's a test
This commit is contained in:
@@ -181,12 +181,15 @@ class AwsCloudwatchClient(Client):
|
|||||||
current_app.logger.info((f"Failed message count: {len(failed_event_set)}"))
|
current_app.logger.info((f"Failed message count: {len(failed_event_set)}"))
|
||||||
raise_exception = False
|
raise_exception = False
|
||||||
for failure in failed_event_set:
|
for failure in failed_event_set:
|
||||||
|
try:
|
||||||
failure = json.loads(failure)
|
failure = json.loads(failure)
|
||||||
if "No quota left for account" == failure["delivery.providerResponse"]:
|
if "No quota left for account" == failure["delivery.providerResponse"]:
|
||||||
current_app.logger.warning(
|
current_app.logger.warning(
|
||||||
hilite("**********NO QUOTA LEFT TO SEND MESSAGES!!!**********")
|
hilite("**********NO QUOTA LEFT TO SEND MESSAGES!!!**********")
|
||||||
)
|
)
|
||||||
raise_exception = True
|
raise_exception = True
|
||||||
|
except Exception:
|
||||||
|
current_app.logger.exception("Malformed delivery receipt")
|
||||||
if raise_exception:
|
if raise_exception:
|
||||||
raise Exception("No Quota Left")
|
raise Exception("No Quota Left")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user