Exception: Bozo::ExecutionError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/bozo/execution_error.rb

Overview

Error raised when a command line executable does not return an exit code of zero.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tool, command, exit_code) ⇒ ExecutionError

Create a new instance.

Parameters:

  • tool (Symbol)

    The friendly name of the tool that failed.

  • command (Array)

    The array of parameters that made up the call.

  • exit_code (Integer)

    The exit code returned by the command



24
25
26
27
28
# File 'lib/bozo/execution_error.rb', line 24

def initialize(tool, command, exit_code)
  @tool = tool
  @command = command
  @exit_code = exit_code
end

Instance Attribute Details

#commandObject (readonly)

The array of parameters that made up the call.



8
9
10
# File 'lib/bozo/execution_error.rb', line 8

def command
  @command
end

#exit_codeObject (readonly)

The exit code returned by the command.



11
12
13
# File 'lib/bozo/execution_error.rb', line 11

def exit_code
  @exit_code
end

#toolObject (readonly)

The friendly name of the tool that failed.



14
15
16
# File 'lib/bozo/execution_error.rb', line 14

def tool
  @tool
end

Instance Method Details

#inspectObject



30
31
32
# File 'lib/bozo/execution_error.rb', line 30

def inspect
  "Execution error: Exit code of #{exit_code} returned from: #{tool} #{command[1..-1].join(' ')}"
end