class TP2::HTTP1Connection
def serve_request
def serve_request headers = parse_headers return false if !headers request = Qeweney::Request.new(headers, self) @app.call(request) persist_connection?(headers) rescue ProtocolError => e msg = "Protocol error: #{e.message}. Closing connection..." @logger&.call(msg) false rescue SystemCallError => e msg = "I/O error: #{e.class} #{e.message}. Closing connection..." @logger&.call(msg) false rescue StandardError => e msg = "Internal error while serving request: #{e.class} #{e.message} (#{e.backtrace.inspect}). Abandoning connection..." @logger&.call(msg) if request && !@done respond(request, 'Internal server error', ':status' => Qeweney::Status::INTERNAL_SERVER_ERROR) end false end