summaryrefslogtreecommitdiff
path: root/paste/httpexceptions.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2005-11-04 00:48:31 +0000
committerianb <devnull@localhost>2005-11-04 00:48:31 +0000
commitb9bebe8c546228dbd18fd34b46207c10d8833c53 (patch)
treeeefed408511b924cdfc3f6666cc670468d036763 /paste/httpexceptions.py
parent4a4ebf30597c01699663e40f83b406a6747d2b41 (diff)
downloadpaste-b9bebe8c546228dbd18fd34b46207c10d8833c53.tar.gz
Add a debugging hook to disable httpexceptions dynamically
Diffstat (limited to 'paste/httpexceptions.py')
-rw-r--r--paste/httpexceptions.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/paste/httpexceptions.py b/paste/httpexceptions.py
index d5a7e07..ce3ab79 100644
--- a/paste/httpexceptions.py
+++ b/paste/httpexceptions.py
@@ -8,6 +8,9 @@ Processes Python exceptions that relate to HTTP exceptions. This
defines a set of extensions, all subclasses of HTTPException, and a
middleware (`middleware`) that catches these exceptions and turns them
into proper responses.
+
+Note: if ``'paste.debug_suppress_httpexceptions'`` is in the request
+and is true, then this middleware will be skipped.
"""
import types
@@ -230,6 +233,8 @@ def middleware(application, global_conf=None):
try:
return application(environ, checked_start_response)
except HTTPException, e:
+ if environ.get('paste.debug_suppress_httpexceptions'):
+ raise
if app_started:
# They've already started the response, so we can't
# do the right thing anymore.