예제 #1
0
 def process_exception(self, request, exception):
     if isinstance(exception, Http403):
         return forbidden(request)
     elif isinstance(exception, Http404):
         return not_found(request, exception)
     else:
         return None
예제 #2
0
파일: http.py 프로젝트: dahool/regeer
 def process_exception(self, request, exception):
     if isinstance(exception, Http403):
         return forbidden(request, exception)
     elif isinstance(exception, Http404):
         return not_found(request, exception)
     elif isinstance(exception, Http503):
         return unavailable(request, exception)
     elif 'OperationalError' == exception.__class__.__name__:
         return unavailable(request, exception[1])
     else:
         return None