Exception: CommandError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/tungsten/common.rb

Direct Known Subclasses

RemoteCommandError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, rc, result, errors = "") ⇒ CommandError



27
28
29
30
31
32
33
34
# File 'lib/tungsten/common.rb', line 27

def initialize(command, rc, result, errors="")
  @command = command
  @rc = rc
  @result = result
  @errors = errors
  
  super(build_message())
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



25
26
27
# File 'lib/tungsten/common.rb', line 25

def command
  @command
end

#errorsObject (readonly)

Returns the value of attribute errors.



25
26
27
# File 'lib/tungsten/common.rb', line 25

def errors
  @errors
end

#rcObject (readonly)

Returns the value of attribute rc.



25
26
27
# File 'lib/tungsten/common.rb', line 25

def rc
  @rc
end

#resultObject (readonly)

Returns the value of attribute result.



25
26
27
# File 'lib/tungsten/common.rb', line 25

def result
  @result
end

Instance Method Details

#build_messageObject



36
37
38
39
40
41
42
43
44
# File 'lib/tungsten/common.rb', line 36

def build_message
  if @errors == ""
    errors = "No STDERR"
  else
    errors = "Errors: #{@errors}"
  end
  
  "Failed: #{command}, RC: #{rc}, Result: #{result}, #{errors}"
end