Navigation Menu

Skip to content

Commit

Permalink
serf-command: use noun for error class name
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Jan 5, 2015
1 parent 04a6453 commit f20597b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/droonga/serf_command.rb
Expand Up @@ -20,16 +20,16 @@
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
@exit_status = exit_status
@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
Expand All @@ -47,7 +47,7 @@ def run
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
Expand Down

0 comments on commit f20597b

Please sign in to comment.