mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-03 21:20:47 -04:00
more exc_info
This commit is contained in:
@@ -194,7 +194,9 @@ def delete_inbound_sms():
|
||||
)
|
||||
)
|
||||
except SQLAlchemyError:
|
||||
current_app.logger.exception("Failed to delete inbound sms notifications")
|
||||
current_app.logger.exception(
|
||||
"Failed to delete inbound sms notifications", exc_info=True
|
||||
)
|
||||
raise
|
||||
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ def process_ses_results(self, response):
|
||||
raise
|
||||
|
||||
except Exception as e:
|
||||
current_app.logger.exception("Error processing SES results: {}".format(type(e)))
|
||||
current_app.logger.exception("Error processing SES results", exc_info=True)
|
||||
self.retry(queue=QueueNames.RETRY)
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ def handle_complaint(ses_message):
|
||||
reference = ses_message["mail"]["messageId"]
|
||||
except KeyError as e:
|
||||
current_app.logger.exception(
|
||||
f"Complaint from SES failed to get reference from message with error: {e}"
|
||||
f"Complaint from SES failed to get reference from message", exc_info=True
|
||||
)
|
||||
return
|
||||
notification = dao_get_notification_history_by_reference(reference)
|
||||
|
||||
@@ -148,7 +148,8 @@ def deliver_sms(self, notification_id):
|
||||
)
|
||||
else:
|
||||
current_app.logger.exception(
|
||||
"SMS notification delivery for id: {} failed".format(notification_id)
|
||||
"SMS notification delivery for id: {} failed".format(notification_id),
|
||||
exc_info=True,
|
||||
)
|
||||
|
||||
try:
|
||||
@@ -188,7 +189,7 @@ def deliver_email(self, notification_id):
|
||||
send_to_providers.send_email_to_provider(notification)
|
||||
except EmailClientNonRetryableException as e:
|
||||
current_app.logger.exception(
|
||||
f"Email notification {notification_id} failed: {e}"
|
||||
f"Email notification {notification_id} failed", exc_info=True
|
||||
)
|
||||
update_notification_status_by_id(notification_id, "technical-failure")
|
||||
except Exception as e:
|
||||
@@ -199,7 +200,7 @@ def deliver_email(self, notification_id):
|
||||
)
|
||||
else:
|
||||
current_app.logger.exception(
|
||||
f"RETRY: Email notification {notification_id} failed"
|
||||
f"RETRY: Email notification {notification_id} failed", exc_info=True
|
||||
)
|
||||
|
||||
self.retry(queue=QueueNames.RETRY)
|
||||
|
||||
@@ -46,7 +46,7 @@ def run_scheduled_jobs():
|
||||
"Job ID {} added to process job queue".format(job.id)
|
||||
)
|
||||
except SQLAlchemyError:
|
||||
current_app.logger.exception("Failed to run scheduled jobs")
|
||||
current_app.logger.exception("Failed to run scheduled jobs", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ def delete_verify_codes():
|
||||
)
|
||||
)
|
||||
except SQLAlchemyError:
|
||||
current_app.logger.exception("Failed to delete verify codes")
|
||||
current_app.logger.exception("Failed to delete verify codes", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ def expire_or_delete_invitations():
|
||||
f"Expire job started {start} finished {utc_now()} expired {expired_invites} invitations"
|
||||
)
|
||||
except SQLAlchemyError:
|
||||
current_app.logger.exception("Failed to expire invitations")
|
||||
current_app.logger.exception("Failed to expire invitations", exc_info=True)
|
||||
raise
|
||||
|
||||
try:
|
||||
@@ -84,7 +84,7 @@ def expire_or_delete_invitations():
|
||||
f"Delete job started {start} finished {utc_now()} deleted {deleted_invites} invitations"
|
||||
)
|
||||
except SQLAlchemyError:
|
||||
current_app.logger.exception("Failed to delete invitations")
|
||||
current_app.logger.exception("Failed to delete invitations", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ def handle_exception(task, notification, notification_id, exc):
|
||||
# SQLAlchemy is throwing a FlushError. So we check if the notification id already exists then do not
|
||||
# send to the retry queue.
|
||||
# This probably (hopefully) is not an issue with Redis as the celery backing store
|
||||
current_app.logger.exception("Retry" + retry_msg)
|
||||
current_app.logger.exception("Retry" + retry_msg, exc_info=True)
|
||||
try:
|
||||
task.retry(queue=QueueNames.RETRY, exc=exc)
|
||||
except task.MaxRetriesExceededError:
|
||||
|
||||
Reference in New Issue
Block a user