summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/webob.rst14
1 files changed, 8 insertions, 6 deletions
diff --git a/docs/narr/webob.rst b/docs/narr/webob.rst
index 30e5ba1d6..2886190f5 100644
--- a/docs/narr/webob.rst
+++ b/docs/narr/webob.rst
@@ -278,12 +278,14 @@ Python 2.5. To get an exception object use ``response.exception``.
You can use this like:
.. code-block:: python
-
- try:
- ... stuff ...
- raise HTTPNotFound('No such resource').exception
- except HTTPException, e:
- return e(environ, start_response)
+ :linenos:
+
+ def aview(request):
+ try:
+ # ... stuff ...
+ raise HTTPNotFound('No such resource').exception
+ except HTTPException, e:
+ return e(environ, start_response)
The exceptions are still WSGI applications, but you cannot set
attributes like ``content_type``, ``charset``, etc. on these exception