diff options
author | ianb <devnull@localhost> | 2007-09-21 03:40:46 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2007-09-21 03:40:46 +0000 |
commit | ca095f39ad9e84ef5cec0d56cd5972ceaf1c6f8e (patch) | |
tree | b661f3fe959f62931348a439e44f3e88144622ab /paste/httpexceptions.py | |
parent | 774d2b1de3ec629f3b510e7ad62f088c0a2ed49c (diff) | |
download | paste-ca095f39ad9e84ef5cec0d56cd5972ceaf1c6f8e.tar.gz |
Simplify the way HTTPExceptionHandler catches HTTPExceptions. You can no longer raise httpexceptions in your app_iter
Diffstat (limited to 'paste/httpexceptions.py')
-rw-r--r-- | paste/httpexceptions.py | 14 |
1 files changed, 3 insertions, 11 deletions
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 |