added default rescue code on exception rescue

This commit is contained in:
Jocelyn Fiat
2011-07-18 16:33:10 +02:00
parent 0abab83566
commit 73e5fd6cd6

View File

@@ -32,8 +32,9 @@ feature {NONE} -- Execution
execute (req: GW_REQUEST; res: GW_RESPONSE) execute (req: GW_REQUEST; res: GW_RESPONSE)
-- Execute the request -- Execute the request
-- See `req.input' and `res.output' for i/o streams -- See `req.input' for input stream
-- `req.environment' for the Gateway environment -- `req.environment' for the Gateway environment
-- and `res.output' for output stream
deferred deferred
end end
@@ -52,6 +53,13 @@ feature {NONE} -- Execution
rescue_execute (req: detachable GW_REQUEST; res: detachable GW_RESPONSE; a_exception: detachable EXCEPTION) rescue_execute (req: detachable GW_REQUEST; res: detachable GW_RESPONSE; a_exception: detachable EXCEPTION)
-- Operation processed on rescue of `execute' -- Operation processed on rescue of `execute'
do 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 ("<pre>" + l_trace + "</pre>")
end
post_execute (req, res) post_execute (req, res)
end end