null+****@clear*****
null+****@clear*****
2012年 3月 6日 (火) 17:56:49 JST
Kouhei Sutou 2012-03-06 17:56:49 +0900 (Tue, 06 Mar 2012) New Revision: 0a85973f0380ce16922695ce292319c903f46747 Log: Log error for groonga-suggest-create-dataset Modified files: lib/groonga/tester.rb Modified: lib/groonga/tester.rb (+9 -4) =================================================================== --- lib/groonga/tester.rb 2012-03-06 17:54:58 +0900 (5203614) +++ lib/groonga/tester.rb 2012-03-06 17:56:49 +0900 (1431b08) @@ -442,10 +442,15 @@ module Groonga command_line = [@context.groonga_suggest_create_dataset, @context.db_path, dataset_name] - log_input(command_line.join(" ")) - IO.popen(command_line, "r:ascii-8bit") do |io| - io.close_write - log_output(io.read) + packed_command_line = command_line.join(" ") + log_input("#{packed_command_line}\n") + begin + IO.popen(command_line, "r:ascii-8bit") do |io| + log_output(io.read) + end + rescue SystemCallError + raise Error.new("failed to run groonga-suggest-create-dataset: " + + "<#{packed_command_line}>: #{$!}") end end