mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-11 07:42:20 -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)
|
failed_event_set = self._get_receipts(log_group_name, start, end)
|
||||||
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
|
||||||
for failure in failed_event_set:
|
for failure in failed_event_set:
|
||||||
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
|
||||||
|
if raise_exception:
|
||||||
|
raise Exception("No Quota Left")
|
||||||
|
|
||||||
return delivered_event_set, failed_event_set
|
return delivered_event_set, failed_event_set
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user