Exception: RemoteCommandError

Inherits:
CommandError show all
Defined in:
lib/tungsten/common.rb

Instance Attribute Summary collapse

Attributes inherited from CommandError

#command, #errors, #rc, #result

Instance Method Summary collapse

Constructor Details

#initialize(user, host, command, rc, result, errors = "") ⇒ RemoteCommandError

Returns a new instance of RemoteCommandError.



50
51
52
53
54
# File 'lib/tungsten/common.rb', line 50

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

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



48
49
50
# File 'lib/tungsten/common.rb', line 48

def host
  @host
end

#userObject (readonly)

Returns the value of attribute user.



48
49
50
# File 'lib/tungsten/common.rb', line 48

def user
  @user
end

Instance Method Details

#build_messageObject



56
57
58
59
60
61
62
63
64
# File 'lib/tungsten/common.rb', line 56

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