diff --git a/app/clients/sms/aws_sns.py b/app/clients/sms/aws_sns.py index d052e63a54..2ada444b67 100644 --- a/app/clients/sms/aws_sns.py +++ b/app/clients/sms/aws_sns.py @@ -66,9 +66,12 @@ def send_sms(self, to, content, reference, multi=True, sender=None, template_id= try: start_time = monotonic() response = client.publish(PhoneNumber=to, Message=content, MessageAttributes=attributes) + except botocore.exceptions.ClientError as e: + self.statsd_client.incr("clients.sns.error") + raise str(e) except Exception as e: self.statsd_client.incr("clients.sns.error") - raise Exception(e) + raise str(e) finally: elapsed_time = monotonic() - start_time self.current_app.logger.info("AWS SNS request finished in {}".format(elapsed_time))