Test logging and error message

This commit is contained in:
Pea Tyczynska
2020-05-06 17:43:34 +01:00
parent 131372bdd8
commit 879d15b736
2 changed files with 12 additions and 5 deletions

View File

@@ -83,13 +83,13 @@ def create_letters_pdf(self, notification_id):
except Exception:
try:
current_app.logger.exception(
"RETRY: calling create-letter-pdf task for notification {} failed".format(notification_id)
f"RETRY: calling create-letter-pdf task for notification {notification_id} failed"
)
self.retry(queue=QueueNames.RETRY)
except self.MaxRetriesExceededError:
message = "RETRY FAILED: Max retries reached. " \
"The task create-letter-pdf failed for notification {}. " \
"Notification has been updated to technical-failure".format(notification_id)
message = f"RETRY FAILED: Max retries reached. " \
f"The task create-letter-pdf failed for notification id {notification_id}. " \
f"Notification has been updated to technical-failure"
update_notification_status_by_id(notification_id, NOTIFICATION_TECHNICAL_FAILURE)
raise NotificationTechnicalFailureException(message)