From 997af2eea91263b1d6c07e02a98f02f81a320acf Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 29 Sep 2016 13:18:38 +0200 Subject: use stderr for errors --- lib/nickserver/dispatcher.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/nickserver/dispatcher.rb') diff --git a/lib/nickserver/dispatcher.rb b/lib/nickserver/dispatcher.rb index f9801d1..26ad09e 100644 --- a/lib/nickserver/dispatcher.rb +++ b/lib/nickserver/dispatcher.rb @@ -40,8 +40,8 @@ module Nickserver def handle(request) handler_chain.handle request rescue RuntimeError => exc - puts "Error: #{exc}" - puts exc.backtrace + $stderr.puts "Error: #{exc}" + $stderr.puts exc.backtrace ErrorResponse.new(exc.to_s) end @@ -64,7 +64,7 @@ module Nickserver def proxy_error_response exc = handler_chain.rescued_exceptions.first if exc - puts " Error: #{exc}" + $stderr.puts " Error: #{exc}" Nickserver::Response.new 502, JSON.dump(error: exc.to_s) end -- cgit v1.2.3