mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Merge branch 'master' into use-reply-to-in-send-to-provider
This commit is contained in:
@@ -13,6 +13,6 @@ def process_ses_results(self, response):
|
||||
errors = process_ses_response(response)
|
||||
if errors:
|
||||
current_app.logger.error(errors)
|
||||
except Exception:
|
||||
except Exception as exc:
|
||||
current_app.logger.exception('Error processing SES results')
|
||||
self.retry(queue=QueueNames.RETRY, exc="SES responses processed with error")
|
||||
self.retry(queue=QueueNames.RETRY)
|
||||
|
||||
@@ -18,6 +18,8 @@ from requests import (
|
||||
RequestException
|
||||
)
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
from botocore.exceptions import ClientError as BotoClientError
|
||||
|
||||
from app import (
|
||||
create_uuid,
|
||||
create_random_identifier,
|
||||
@@ -326,12 +328,13 @@ def build_dvla_file(self, job_id):
|
||||
)
|
||||
dao_update_job_status(job_id, JOB_STATUS_READY_TO_SEND)
|
||||
else:
|
||||
current_app.logger.info("All notifications for job {} are not persisted".format(job_id))
|
||||
self.retry(queue=QueueNames.RETRY, exc="All notifications for job {} are not persisted".format(job_id))
|
||||
except Exception as e:
|
||||
# ? should this retry?
|
||||
msg = "All notifications for job {} are not persisted".format(job_id)
|
||||
current_app.logger.info(msg)
|
||||
self.retry(queue=QueueNames.RETRY)
|
||||
# specifically don't catch celery.retry errors
|
||||
except (SQLAlchemyError, BotoClientError):
|
||||
current_app.logger.exception("build_dvla_file threw exception")
|
||||
raise e
|
||||
self.retry(queue=QueueNames.RETRY)
|
||||
|
||||
|
||||
@notify_celery.task(bind=True, name='update-letter-job-to-sent')
|
||||
@@ -523,9 +526,7 @@ def send_inbound_sms_to_service(self, inbound_sms_id, service_id):
|
||||
)
|
||||
if not isinstance(e, HTTPError) or e.response.status_code >= 500:
|
||||
try:
|
||||
self.retry(queue=QueueNames.RETRY,
|
||||
exc='Unable to send_inbound_sms_to_service for service_id: {} and url: {}. \n{}'.format(
|
||||
service_id, inbound_api.url, e))
|
||||
self.retry(queue=QueueNames.RETRY)
|
||||
except self.MaxRetriesExceededError:
|
||||
current_app.logger.exception('Retry: send_inbound_sms_to_service has retried the max number of times')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user