mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 10:03:38 -04:00
move statsd call out of generic tryexcept
we shouldn't try and use statsd to log an error if they fail, for example [we also shouldn't retry sending the message but that's a problem for another time]
This commit is contained in:
@@ -90,13 +90,15 @@ class AwsSesClient(EmailClient):
|
|||||||
},
|
},
|
||||||
'Body': body
|
'Body': body
|
||||||
},
|
},
|
||||||
ReplyToAddresses=reply_to_addresses)
|
ReplyToAddresses=reply_to_addresses
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
# TODO logging exceptions
|
||||||
|
self.statsd_client.incr("clients.ses.error")
|
||||||
|
raise AwsSesClientException(str(e))
|
||||||
|
|
||||||
elapsed_time = monotonic() - start_time
|
elapsed_time = monotonic() - start_time
|
||||||
current_app.logger.info("AWS SES request finished in {}".format(elapsed_time))
|
current_app.logger.info("AWS SES request finished in {}".format(elapsed_time))
|
||||||
self.statsd_client.timing("clients.ses.request-time", elapsed_time)
|
self.statsd_client.timing("clients.ses.request-time", elapsed_time)
|
||||||
self.statsd_client.incr("clients.ses.success")
|
self.statsd_client.incr("clients.ses.success")
|
||||||
return response['MessageId']
|
return response['MessageId']
|
||||||
except Exception as e:
|
|
||||||
# TODO logging exceptions
|
|
||||||
self.statsd_client.incr("clients.ses.error")
|
|
||||||
raise AwsSesClientException(str(e))
|
|
||||||
|
|||||||
Reference in New Issue
Block a user