14 lines
343 B
Python
14 lines
343 B
Python
|
# -*- coding: utf-8 -*-
|
||
|
# vi:si:et:sw=4:sts=4:ts=4
|
||
|
|
||
|
from shortcuts import Http404Json, render_to_json_response
|
||
|
|
||
|
class ExceptionMiddleware(object):
|
||
|
|
||
|
def process_exception(self, request, exception):
|
||
|
if isinstance(exception, Http404Json):
|
||
|
return render_to_json_response(exception.response)
|
||
|
else:
|
||
|
return None
|
||
|
|