diff --git a/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e b/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e index a5891067..91c5d2ac 100644 --- a/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e +++ b/library/server/ewsgi/connectors/nino/src/ewf_nino_connector.e @@ -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 - 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) + 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 ("
" + l_trace + "") + end + end + end + end + rescue + rescued := True + retry end note diff --git a/library/server/ewsgi/src/wgi_application.e b/library/server/ewsgi/src/wgi_application.e index e7c1849c..58df970f 100644 --- a/library/server/ewsgi/src/wgi_application.e +++ b/library/server/ewsgi/src/wgi_application.e @@ -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 ("
" + l_trace + "") - 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: "[