Hi Roman,
In data mercoledì 20 gennaio 2010 18:37:45, Tibor Simko ha scritto:
> On Wed, 20 Jan 2010, Roman Chyla wrote:
> > OK, sending patch
> > But the output is not optimal, the "200 OK" does not feel right...
>
> Sam, please have a look.
>
> Best regards
I was not able cleanly apply your patch on the latest GIT master version.
There the 200 OK error should have been fixed.
Could you try this patch (which applies on latest GIT master) and see if this
fix your issue?
Best regards,
Sam
--
Samuele Kaplun ** CERN Document Server ** <http://cds.cern.ch/>
From bc52c593600f87691632460ab09d10916ac61dfe Mon Sep 17 00:00:00 2001
From: Samuele Kaplun <[email protected]>
Date: Thu, 21 Jan 2010 10:14:34 +0100
Subject: [PATCH] WSGI: Improved catching of unhandled exceptions
---
modules/webstyle/lib/webinterface_handler_wsgi.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/modules/webstyle/lib/webinterface_handler_wsgi.py b/modules/webstyle/lib/webinterface_handler_wsgi.py
index f32baff..8494a86 100644
--- a/modules/webstyle/lib/webinterface_handler_wsgi.py
+++ b/modules/webstyle/lib/webinterface_handler_wsgi.py
@@ -360,7 +360,8 @@ def application(environ, start_response):
req.headers_in.get('referer'))
if admin_to_be_alerted:
register_exception(req=req, alert_admin=True)
- start_response(req.get_wsgi_status(), req.get_low_level_headers(), sys.exc_info())
+ if not req.response_sent_p:
+ start_response(req.get_wsgi_status(), req.get_low_level_headers(), sys.exc_info())
return generate_error_page(req, admin_to_be_alerted)
else:
req.flush()
@@ -368,7 +369,8 @@ def application(environ, start_response):
register_exception(req=req, alert_admin=True)
req.status = HTTP_INTERNAL_SERVER_ERROR
req.headers_out['content-type'] = 'text/html'
- start_response(req.get_wsgi_status(), req.get_low_level_headers(), sys.exc_info())
+ if not req.response_sent_p:
+ start_response(req.get_wsgi_status(), req.get_low_level_headers(), sys.exc_info())
return generate_error_page(req)
finally:
for (callback, data) in req.get_cleanups():
--
1.6.3.3