From d5209c2272de27cbdc3edef8386a8e5bf430edcd Mon Sep 17 00:00:00 2001 From: Ian Bicking Date: Fri, 21 Sep 2007 03:40:46 +0000 Subject: Simplify the way HTTPExceptionHandler catches HTTPExceptions. You can no longer raise httpexceptions in your app_iter --- paste/httpexceptions.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'paste/httpexceptions.py') diff --git a/paste/httpexceptions.py b/paste/httpexceptions.py index 946f8f3..cd3b81a 100644 --- a/paste/httpexceptions.py +++ b/paste/httpexceptions.py @@ -628,18 +628,10 @@ class HTTPExceptionHandler(object): environ['paste.httpexceptions'] = self environ.setdefault('paste.expected_exceptions', []).append(HTTPException) - return catch_errors_app( - self.application, environ, start_response, - self.send_http_response, catch=HTTPException) - - def send_http_response(self, environ, start_response, exc_info): try: - exc = exc_info[1] - assert(isinstance(exc, HTTPException)), \ - 'send_http_response triggered via a non HTTPException' - return exc.wsgi_application(environ, start_response, exc_info) - finally: - exc_info = None + return self.application(environ, start_response) + except HTTPException, exc: + return exc(environ, start_response) def middleware(*args, **kw): import warnings -- cgit v1.2.1