diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-10-15 02:20:35 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-10-15 02:20:35 +0000 |
| commit | a2e26150b77cd2cdad4cc9de120a87a6370c6dd5 (patch) | |
| tree | 669936b4c04c22eae6e6e71aa3fad66f2a5e4693 /docs/middleware.txt | |
| parent | 24154b216682dfef7ff647a5c2f698b89ba429a6 (diff) | |
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
Diffstat (limited to 'docs/middleware.txt')
| -rw-r--r-- | docs/middleware.txt | 13 |
1 files changed, 13 insertions, 0 deletions
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 ---------- |
