Exception: Distem::Lib::ShellError

Inherits:
DistemError show all
Defined in:
lib/distem/distemlib/errors.rb

Overview

An error occured during the execution of a shell command

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (ShellError) initialize(cmd, ret, err = "")

Returns a new instance of ShellError



58
59
60
61
62
63
# File 'lib/distem/distemlib/errors.rb', line 58

def initialize(cmd, ret, err = "")
  @hostname = Socket.gethostname
  @cmd = cmd
  @ret = ret
  @err = err
end

Instance Attribute Details

- (Object) cmd (readonly)

Returns the value of attribute cmd



57
58
59
# File 'lib/distem/distemlib/errors.rb', line 57

def cmd
  @cmd
end

- (Object) err (readonly)

Returns the value of attribute err



57
58
59
# File 'lib/distem/distemlib/errors.rb', line 57

def err
  @err
end

- (Object) hostname (readonly)

Returns the value of attribute hostname



57
58
59
# File 'lib/distem/distemlib/errors.rb', line 57

def hostname
  @hostname
end

- (Object) ret (readonly)

Returns the value of attribute ret



57
58
59
# File 'lib/distem/distemlib/errors.rb', line 57

def ret
  @ret
end

Instance Method Details

- (Object) to_s



65
66
67
# File 'lib/distem/distemlib/errors.rb', line 65

def to_s
  return "cmd:'#{@cmd}' host:'#{@hostname}' result:'#{@ret}' err:'#{@err}'"
end