mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-09 06:32:11 -05:00
raise exception if we see No Quota Left
This commit is contained in:
@@ -179,13 +179,16 @@ class AwsCloudwatchClient(Client):
|
||||
)
|
||||
failed_event_set = self._get_receipts(log_group_name, start, end)
|
||||
current_app.logger.info((f"Failed message count: {len(failed_event_set)}"))
|
||||
|
||||
raise_exception = False
|
||||
for failure in failed_event_set:
|
||||
failure = json.loads(failure)
|
||||
if "No quota left for account" == failure["delivery.providerResponse"]:
|
||||
current_app.logger.warning(
|
||||
hilite("**********NO QUOTA LEFT TO SEND MESSAGES!!!**********")
|
||||
)
|
||||
raise_exception = True
|
||||
if raise_exception:
|
||||
raise Exception("No Quota Left")
|
||||
|
||||
return delivered_event_set, failed_event_set
|
||||
|
||||
|
||||
Reference in New Issue
Block a user