[Groonga-commit] droonga/droonga-engine at f20597b [master] serf-command: use noun for error class name

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Jan 5 17:40:23 JST 2015


Kouhei Sutou	2015-01-05 17:40:23 +0900 (Mon, 05 Jan 2015)

  New Revision: f20597bcd41cd4f0158b7f9279e119373c77975c
  https://github.com/droonga/droonga-engine/commit/f20597bcd41cd4f0158b7f9279e119373c77975c

  Message:
    serf-command: use noun for error class name

  Modified files:
    lib/droonga/serf_command.rb

  Modified: lib/droonga/serf_command.rb (+4 -4)
===================================================================
--- lib/droonga/serf_command.rb    2015-01-05 17:23:13 +0900 (3889e6e)
+++ lib/droonga/serf_command.rb    2015-01-05 17:40:23 +0900 (6234e26)
@@ -20,7 +20,7 @@ require "droonga/loggable"
 module Droonga
   class Serf
     class Command
-      class Failed < Error
+      class Failure < Error
         attr_reader :command_line, :exit_status, :output, :error
         def initialize(command_line, exit_status, output, error)
           @command_line = command_line
@@ -28,8 +28,8 @@ module Droonga
           @output = output
           @error = error
           message = "Failed to run serf: (#{@exit_status}): "
-          message << "#{@error}[#{@output}]: "
-          message << @command_line..join(" ")
+          message << "#{@error.strip}[#{@output.strip}]: "
+          message << @command_line.join(" ")
           super(message)
         end
       end
@@ -47,7 +47,7 @@ module Droonga
         stdout, stderror, status = Open3.capture3(*command_line,
                                                   :pgroup => true)
         unless status.success?
-          raise Failed.new(command_line, status.to_i, stdout, stderror)
+          raise Failure.new(command_line, status.to_i, stdout, stderror)
         end
         logger.error("run: #{stderror}") unless stderror.empty?
         stdout
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index