diff options
| author | Ian Bicking <ian@ianbicking.org> | 2007-09-21 03:40:46 +0000 |
|---|---|---|
| committer | Ian Bicking <ian@ianbicking.org> | 2007-09-21 03:40:46 +0000 |
| commit | d5209c2272de27cbdc3edef8386a8e5bf430edcd (patch) | |
| tree | b661f3fe959f62931348a439e44f3e88144622ab /paste/httpexceptions.py | |
| parent | 1e9c24563b4e9821c4e988142b9f0d90a0f92930 (diff) | |
| download | paste-git-d5209c2272de27cbdc3edef8386a8e5bf430edcd.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 |
