From a2e26150b77cd2cdad4cc9de120a87a6370c6dd5 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sat, 15 Oct 2005 02:20:35 +0000 Subject: Fixed #616 -- Added a process_exception() hook to middleware framework. Thanks, Hugo git-svn-id: http://code.djangoproject.com/svn/django/trunk@880 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/middleware.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs') diff --git a/docs/middleware.txt b/docs/middleware.txt index dfa1947bbd..33cb1a38e4 100644 --- a/docs/middleware.txt +++ b/docs/middleware.txt @@ -168,6 +168,19 @@ object returned by a Django view. the given ``response``, or it could create and return a brand-new ``HttpResponse``. +process_exception +----------------- + +Interface: ``process_exception(self, request, exception)`` + +``request`` is an ``HttpRequest`` object. ``exception`` is an ``Exception`` +object raised by the view function. + +Django calls ``process_exception()`` when a view raises an exception. +``process_exception()`` should return either ``None`` or an ``HttpResponse`` +object. If it returns an ``HttpResponse`` object, the response will be returned +to the browser. Otherwise, default exception handling kicks in. + Guidelines ---------- -- cgit v1.3