Better handling for cc and bcc recipients.

Fixes #59.
This commit is contained in:
medmunds
2014-01-25 12:35:23 -08:00
parent 1e44392b13
commit d7c06bb576
5 changed files with 49 additions and 59 deletions

View File

@@ -1,11 +1,12 @@
from requests import HTTPError
class MandrillAPIError(HTTPError):
"""Exception for unsuccessful response from Mandrill API."""
def __init__(self, status_code, response=None, log_message=None):
super(MandrillAPIError, self).__init__()
def __init__(self, status_code, response=None, log_message=None, *args, **kwargs):
super(MandrillAPIError, self).__init__(*args, **kwargs)
self.status_code = status_code
self.response = response # often contains helpful Mandrill info
self.response = response # often contains helpful Mandrill info
self.log_message = log_message
def __str__(self):
@@ -22,8 +23,8 @@ class NotSupportedByMandrillError(ValueError):
This is typically raised when attempting to send a Django EmailMessage that
uses options or values you might expect to work, but that are silently
ignored by or can't be communicated to Mandrill's API. (E.g., unsupported
attachment types, multiple bcc recipients.)
ignored by or can't be communicated to Mandrill's API. (E.g., non-HTML
alternative parts.)
It's generally *not* raised for Mandrill-specific features, like limitations
on Mandrill tag names or restrictions on from emails. (Djrill expects