mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
Cleanup Djrill exceptions
* Add common base DjrillException * Simplify backend by moving logic to describe errors into base DjrillException * Add NotSerializableForMandrillError for JSON serialization errors
This commit is contained in:
@@ -88,6 +88,8 @@ Other Djrill 2.0 Changes
|
||||
(You can also directly manage your own long-lived Djrill connection across multiple sends,
|
||||
by calling open and close on :ref:`Django's email backend <django:topic-email-backends>`.)
|
||||
|
||||
* Add :exc:`djrill.NotSerializableForMandrillError`
|
||||
|
||||
|
||||
Older Releases
|
||||
--------------
|
||||
|
||||
@@ -392,3 +392,15 @@ Exceptions
|
||||
`API error log <https://mandrillapp.com/settings/api>`_ to view the full API
|
||||
request and error response.)
|
||||
|
||||
|
||||
.. exception:: djrill.NotSerializableForMandrillError
|
||||
|
||||
The send call will raise a :exc:`~!djrill.NotSerializableForMandrillError` exception
|
||||
if the message has attached data which cannot be serialized to JSON for the Mandrill API.
|
||||
|
||||
See :ref:`formatting-merge-data` for more information.
|
||||
|
||||
.. versionadded:: 2.0
|
||||
Djrill 1.x raised a generic `TypeError` in this case.
|
||||
:exc:`~!djrill.NotSerializableForMandrillError` is a subclass of `TypeError`
|
||||
for compatibility with existing code.
|
||||
|
||||
@@ -75,6 +75,9 @@ which means advanced template users can include dicts and lists as merge vars
|
||||
(for templates designed to handle objects and arrays).
|
||||
See the Python :class:`json.JSONEncoder` docs for a list of allowable types.
|
||||
|
||||
Djrill will raise :exc:`djrill.NotSerializableForMandrillError` if you attempt
|
||||
to send a message with non-json-serializable data.
|
||||
|
||||
|
||||
How To Use Default Mandrill Subject and From fields
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user