lib/rack/handler/ftw.rb in ftw-0.0.13 vs lib/rack/handler/ftw.rb in ftw-0.0.14

- old
+ new

@@ -200,12 +200,17 @@ headers.each do |name, value| response.headers.add(name, value) end response.body = body - connection.write(response.to_s + CRLF) - body.each do |chunk| - connection.write(chunk) + begin + connection.write(response.to_s + CRLF) + body.each do |chunk| + connection.write(chunk) + end + rescue => e + @logger.error(e) + connection.disconnect(e.inspect) end end # def handle_request # Get the logger. def logger