From b9bebe8c546228dbd18fd34b46207c10d8833c53 Mon Sep 17 00:00:00 2001 From: ianb Date: Fri, 4 Nov 2005 00:48:31 +0000 Subject: Add a debugging hook to disable httpexceptions dynamically --- paste/httpexceptions.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'paste/httpexceptions.py') 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. -- cgit v1.2.1