Removed handling of internal error from WGI_APPLICATION
And for now added it into nino connector
This commit is contained in:
@@ -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)
|
process_request (env: HASH_TABLE [STRING, STRING]; a_headers_text: STRING; a_input: HTTP_INPUT_STREAM; a_output: HTTP_OUTPUT_STREAM)
|
||||||
local
|
local
|
||||||
req: WGI_REQUEST_FROM_TABLE
|
req: WGI_REQUEST_FROM_TABLE
|
||||||
res: WGI_RESPONSE_STREAM_BUFFER
|
res: detachable WGI_RESPONSE_STREAM_BUFFER
|
||||||
|
rescued: BOOLEAN
|
||||||
do
|
do
|
||||||
create req.make (env, create {EWF_NINO_INPUT_STREAM}.make (a_input))
|
if not rescued then
|
||||||
create res.make (create {EWF_NINO_OUTPUT_STREAM}.make (a_output))
|
create req.make (env, create {EWF_NINO_INPUT_STREAM}.make (a_input))
|
||||||
req.set_meta_string_variable ("RAW_HEADER_DATA", a_headers_text)
|
create res.make (create {EWF_NINO_OUTPUT_STREAM}.make (a_output))
|
||||||
application.execute (req, res)
|
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
|
end
|
||||||
|
|
||||||
note
|
note
|
||||||
|
|||||||
@@ -25,43 +25,7 @@ feature -- Execution
|
|||||||
res_status_set: res.status_is_set
|
res_status_set: res.status_is_set
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Process request
|
note
|
||||||
|
|
||||||
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
|
|
||||||
copyright: "2011-2011, Eiffel Software and others"
|
copyright: "2011-2011, Eiffel Software and others"
|
||||||
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
|
||||||
source: "[
|
source: "[
|
||||||
|
|||||||
Reference in New Issue
Block a user