Sha256: 489af86e191473b1cf6fbea930a214df79b608a5169612ed3e0f69ebf86cecb8

Contents?: true

Size: 853 Bytes

Versions: 14

Compression:

Stored size: 853 Bytes

Contents

module R10K
  class ExecutionFailure < StandardError
    attr_accessor :exit_code, :stdout, :stderr
  end

  # An error class that accepts an optional hash.
  #
  # @overload initialize(mesg)
  #   @param mesg [String] The exception mesg
  #
  # @overload initialize(mesg, options)
  #   @param mesg [String] The exception mesg
  #   @param options [Hash] A set of options to store on the exception
  #
  # @overload initialize(options)
  #   @param options [Hash] A set of options to store on the exception
  #
  class R10KError < StandardError
    def initialize(mesg = nil, options = {})
      if mesg.is_a? String
        super(mesg)
        @mesg    = mesg
        @options = options
      elsif mesg.is_a? Hash
        @mesg    = nil
        @options = mesg
      elsif mesg.nil? and options
        @options = options
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
r10k-1.3.5 lib/r10k/errors.rb
r10k-1.3.4 lib/r10k/errors.rb
r10k-1.2.4 lib/r10k/errors.rb
r10k-1.3.3 lib/r10k/errors.rb
r10k-1.3.2 lib/r10k/errors.rb
r10k-1.2.3 lib/r10k/errors.rb
r10k-1.3.1 lib/r10k/errors.rb
r10k-1.2.2 lib/r10k/errors.rb
r10k-1.3.0 lib/r10k/errors.rb
r10k-1.3.0rc1 lib/r10k/errors.rb
r10k-1.2.1 lib/r10k/errors.rb
r10k-1.2.0 lib/r10k/errors.rb
r10k-1.2.0rc2 lib/r10k/errors.rb
r10k-1.2.0rc1 lib/r10k/errors.rb