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.



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

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]


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

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.



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

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