Sha256: 42ebacedcf32d3f9bf0f5a77a60be0dc6f454e4c22df6ab364bc4e84d93a7693

Contents?: true

Size: 958 Bytes

Versions: 7

Compression:

Stored size: 958 Bytes

Contents

module Bozo

  # Error raised when a command line executable does not return an exit code of
  # zero.
  class ExecutionError < StandardError

    # The array of parameters that made up the call.
    attr_reader :command

    # The exit code returned by the command.
    attr_reader :exit_code

    # The friendly name of the tool that failed.
    attr_reader :tool

    # Create a new instance.
    #
    # @param [Symbol] tool
    #     The friendly name of the tool that failed.
    # @param [Array] command
    #     The array of parameters that made up the call.
    # @param [Integer] exit_code
    #     The exit code returned by the command
    def initialize(tool, command, exit_code)
      @tool = tool
      @command = command
      @exit_code = exit_code
    end
    
    def inspect
      "Execution error: Exit code of #{exit_code} returned from: #{tool} #{command[1..-1].join(' ')}"
    end
    
  end
  
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
bozo-0.5.0 lib/bozo/execution_error.rb
bozo-0.4.2 lib/bozo/execution_error.rb
bozo-0.4.1 lib/bozo/execution_error.rb
bozo-0.4.0 lib/bozo/execution_error.rb
bozo-0.3.3 lib/bozo/execution_error.rb
iisconfig-0.0.1.pre2 build/bundler/ruby/1.9.1/bundler/gems/bozo-2cbbc5714688/lib/bozo/execution_error.rb
iisconfig-0.0.1.pre1 build/bundler/ruby/1.9.1/bundler/gems/bozo-2cbbc5714688/lib/bozo/execution_error.rb