Permalink
Browse files

Adding SESDomainEndsWithDotError, which appears when an error of the …

…same type is returned in the SendEmail response.
  • Loading branch information...
Greg Taylor
Greg Taylor committed Dec 27, 2011
1 parent d04fcd1 commit 95e70976aef25fbe22d3915f71638248813afdfd
Showing with 11 additions and 0 deletions.
  1. +4 −0 boto/ses/connection.py
  2. +7 −0 boto/ses/exceptions.py
View
@@ -139,6 +139,10 @@ def _handle_error(self, response, body):
# Your account has sent above its allowed requests a second rate.
ExceptionToRaise = ses_exceptions.SESMaxSendingRateExceededError
exc_reason = "Maximum sending rate exceeded."
+ elif "Domain ends with dot." in body:
+ # Recipient address ends with a dot/period. This is invalid.
+ ExceptionToRaise = ses_exceptions.SESDomainEndsWithDotError
+ exc_reason = "Domain ends with dot."
else:
# This is either a common AWS error, or one that we don't devote
# its own exception to.
View
@@ -32,4 +32,11 @@ class SESMaxSendingRateExceededError(BotoServerError):
"""
Your account's requests/second limit has been exceeded.
"""
+ pass
+
+
+class SESDomainEndsWithDotError(BotoServerError):
+ """
+ Recipient's email address' domain ends with a period/dot.
+ """
pass

0 comments on commit 95e7097

Please sign in to comment.