Exception: R10K::Util::Subprocess::SubprocessError

Inherits:
R10KError
  • Object
show all
Defined in:
lib/r10k/util/subprocess.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mesg = nil, options = {}) ⇒ SubprocessError

Returns a new instance of SubprocessError.



92
93
94
95
# File 'lib/r10k/util/subprocess.rb', line 92

def initialize(mesg = nil, options = {})
  super
  @result = @options[:result]
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



90
91
92
# File 'lib/r10k/util/subprocess.rb', line 90

def result
  @result
end

Instance Method Details

#to_sObject



97
98
99
100
101
102
103
# File 'lib/r10k/util/subprocess.rb', line 97

def to_s
  if @mesg
    @mesg
  else
    "Command #{@result.cmd} exited with #{@result.exit_code}: #{@result.stderr}"
  end
end