diff --git a/src/postorius/middleware.py b/src/postorius/middleware.py index 2c1f874..4dc9f59 100644 --- a/src/postorius/middleware.py +++ b/src/postorius/middleware.py @@ -20,10 +20,12 @@ from postorius import utils from postorius.models import MailmanApiError +from mailmanclient import MailmanConnectionError class PostoriusMiddleware(object): def process_exception(self, request, exception): - if isinstance(exception, MailmanApiError): + if isinstance(exception, MailmanApiError) or isinstance( + exception, MailmanConnectionError): return utils.render_api_error(request)