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

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

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of SubprocessError.



95
96
97
98
# File 'lib/r10k/util/subprocess.rb', line 95

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

Instance Attribute Details

#resultObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

!@attribute [r] result

@return [R10K::Util::Subprocess::Result]


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

def result
  @result
end

Instance Method Details

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



100
101
102
103
104
105
106
# File 'lib/r10k/util/subprocess.rb', line 100

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