Make sure error message is logged as part of the exception

This commit is contained in:
David McDonald
2020-12-31 11:08:09 +00:00
parent 977554781f
commit 56879d0d22

View File

@@ -122,7 +122,7 @@ class AwsSesClient(EmailClient):
# http://docs.aws.amazon.com/ses/latest/DeveloperGuide/api-error-codes.html
if e.response['Error']['Code'] == 'InvalidParameterValue':
raise EmailClientNonRetryableException(str(e))
raise EmailClientNonRetryableException(e.response['Error']['Message'])
elif (
e.response['Error']['Code'] == 'Throttling'
and e.response['Error']['Message'] == 'Maximum sending rate exceeded.'