app/soc/middleware/exception_handler.py
changeset 2906 6fb53ed7aff4
parent 2901 6c8ba67289a6
equal deleted inserted replaced
2905:378833eb5a95 2906:6fb53ed7aff4
    36 class ExceptionHandlerMiddleware(object):
    36 class ExceptionHandlerMiddleware(object):
    37   """Middleware class to handle exceptions..
    37   """Middleware class to handle exceptions..
    38   """
    38   """
    39 
    39 
    40   def process_exception(self, request, exception):
    40   def process_exception(self, request, exception):
       
    41     """Called when an uncaught exception is raised.
       
    42 
       
    43     See the Django middleware documentation for an explanation of
       
    44     the method signature.
       
    45     """
       
    46 
    41     template = None
    47     template = None
    42     context = responses.getUniversalContext(request)
    48     context = responses.getUniversalContext(request)
    43 
    49 
    44     if isinstance(exception, DeadlineExceededError):
    50     if isinstance(exception, DeadlineExceededError):
    45       template = 'soc/deadline_exceeded.html'
    51       template = 'soc/deadline_exceeded.html'