mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 15:15:38 -05:00
add tests for ses client
This commit is contained in:
@@ -96,11 +96,17 @@ class AwsSesClient(EmailClient):
|
||||
ReplyToAddresses=reply_to_addresses
|
||||
)
|
||||
except botocore.exceptions.ClientError as e:
|
||||
self.statsd_client.incr("clients.ses.error")
|
||||
|
||||
# http://docs.aws.amazon.com/ses/latest/DeveloperGuide/api-error-codes.html
|
||||
if e.response['Error']['Code'] == 'InvalidParameterValue':
|
||||
raise InvalidEmailError('email: "{}" message: "{}"'.format(
|
||||
to_addresses[0],
|
||||
e.response['Error']['Message']
|
||||
))
|
||||
else:
|
||||
self.statsd_client.incr("clients.ses.error")
|
||||
raise AwsSesClientException(str(e))
|
||||
except Exception as e:
|
||||
self.statsd_client.incr("clients.ses.error")
|
||||
raise AwsSesClientException(str(e))
|
||||
|
||||
Reference in New Issue
Block a user