mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
12 lines
400 B
Python
12 lines
400 B
Python
# coding: utf-8
|
|
|
|
from modoboa.lib import ajax_response
|
|
from modoboa.extensions.webmail.lib import WebmailError
|
|
|
|
class WebmailErrorMiddleware(object):
|
|
def process_exception(self, request, exception):
|
|
if not isinstance(exception, WebmailError):
|
|
return None
|
|
return ajax_response(request, status="ko",
|
|
respmsg=str(exception), norefresh=True)
|