Skip to content

Commit

Permalink
again
Browse files Browse the repository at this point in the history
  • Loading branch information
sastels committed May 14, 2024
1 parent fb8f395 commit 2a80780
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/clients/sms/aws_sns.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from time import monotonic

import boto3
import botocore
import phonenumbers
from notifications_utils.statsd_decorators import statsd

Expand Down Expand Up @@ -66,12 +65,9 @@ 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 str(e)
raise Exception(e)
finally:
elapsed_time = monotonic() - start_time
self.current_app.logger.info("AWS SNS request finished in {}".format(elapsed_time))
Expand Down

0 comments on commit 2a80780

Please sign in to comment.