Removed handling of internal error from WGI_APPLICATION

And for now added it into nino connector
This commit is contained in:
Jocelyn Fiat
2011-10-14 14:15:23 +02:00
parent dec1958909
commit 21e973f8a4
2 changed files with 23 additions and 42 deletions

View File

@@ -80,12 +80,29 @@ feature -- Server
process_request (env: HASH_TABLE [STRING, STRING]; a_headers_text: STRING; a_input: HTTP_INPUT_STREAM; a_output: HTTP_OUTPUT_STREAM)
local
req: WGI_REQUEST_FROM_TABLE
res: WGI_RESPONSE_STREAM_BUFFER
res: detachable WGI_RESPONSE_STREAM_BUFFER
rescued: BOOLEAN
do
if not rescued then
create req.make (env, create {EWF_NINO_INPUT_STREAM}.make (a_input))
create res.make (create {EWF_NINO_OUTPUT_STREAM}.make (a_output))
req.set_meta_string_variable ("RAW_HEADER_DATA", a_headers_text)
application.execute (req, res)
else
if attached (create {EXCEPTION_MANAGER}).last_exception as e and then attached e.exception_trace as l_trace then
if res /= Void then
if not res.status_is_set then
res.write_header ({HTTP_STATUS_CODE}.internal_server_error, Void)
end
if res.message_writable then
res.write_string ("<pre>" + l_trace + "</pre>")
end
end
end
end
rescue
rescued := True
retry
end
note

View File

@@ -25,43 +25,7 @@ feature -- Execution
res_status_set: res.status_is_set
end
feature -- Process request
frozen process (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER)
-- Process request with environment `env', and i/o streams `a_input' and `a_output'
local
rescued: BOOLEAN
do
if not rescued then
request_count := request_count + 1
execute (req, res)
else
rescue_execute (req, res, (create {EXCEPTION_MANAGER}).last_exception)
end
if res /= Void then
res.commit
end
end
feature -- Access
request_count: INTEGER
-- Request count
feature {NONE} -- Execution
rescue_execute (req: WGI_REQUEST; res: WGI_RESPONSE_BUFFER; a_exception: detachable EXCEPTION)
-- Operation processed on rescue of `execute'
do
if
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
end
;note
note
copyright: "2011-2011, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[