--- a/pytask/middleware/exceptions.py Tue Feb 01 02:31:53 2011 +0530
+++ b/pytask/middleware/exceptions.py Tue Feb 01 04:32:53 2011 +0530
@@ -10,6 +10,7 @@
from django.template import loader
from django.template import RequestContext
+from pytask.helpers.exceptions import PyTaskException
from pytask.helpers.exceptions import UnauthorizedAccess
@@ -21,7 +22,8 @@
"""Process the exception raised.
"""
- if isinstance(exception, UnauthorizedAccess):
+ if (isinstance(exception, PyTaskException) or
+ isinstance(exception, UnauthorizedAccess)):
template = loader.get_template('error.html')
context = RequestContext(request, {
'error_message': exception.message