From 73e5fd6cd6f08b4bfb5c6f8b155eff9e40bfc353 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Mon, 18 Jul 2011 16:33:10 +0200 Subject: [PATCH] added default rescue code on exception rescue --- library/server/ewsgi/src/gw_application.e | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/library/server/ewsgi/src/gw_application.e b/library/server/ewsgi/src/gw_application.e index a0a9370b..d330af50 100644 --- a/library/server/ewsgi/src/gw_application.e +++ b/library/server/ewsgi/src/gw_application.e @@ -32,8 +32,9 @@ feature {NONE} -- Execution execute (req: GW_REQUEST; res: GW_RESPONSE) -- Execute the request - -- See `req.input' and `res.output' for i/o streams - -- `req.environment' for the Gateway environment + -- See `req.input' for input stream + -- `req.environment' for the Gateway environment + -- and `res.output' for output stream deferred end @@ -52,6 +53,13 @@ feature {NONE} -- Execution rescue_execute (req: detachable GW_REQUEST; res: detachable GW_RESPONSE; a_exception: detachable EXCEPTION) -- Operation processed on rescue of `execute' do + if + req /= Void and res /= Void + and a_exception /= Void and then attached a_exception.exception_trace as l_trace + then + res.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void) + res.write_string ("
" + l_trace + "
") + end post_execute (req, res) end