Exception: Cisco::CliError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/cisco_node_utils/node.rb

Overview

Error class raised by the config_set and config_get APIs if the device encounters an issue trying to act on the requested CLI.

command - the specific CLI that was rejected clierror - any error string from the device

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, clierror, previous) ⇒ CliError



35
36
37
38
39
# File 'lib/cisco_node_utils/node.rb', line 35

def initialize(command, clierror, previous)
  @command = command
  @clierror = clierror.rstrip if clierror.kind_of? String
  @previous = previous
end

Instance Attribute Details

#clierrorObject (readonly)

Returns the value of attribute clierror.



34
35
36
# File 'lib/cisco_node_utils/node.rb', line 34

def clierror
  @clierror
end

#commandObject (readonly)

Returns the value of attribute command.



34
35
36
# File 'lib/cisco_node_utils/node.rb', line 34

def command
  @command
end

#previousObject (readonly)

Returns the value of attribute previous.



34
35
36
# File 'lib/cisco_node_utils/node.rb', line 34

def previous
  @previous
end

Instance Method Details

#to_sObject



41
42
43
# File 'lib/cisco_node_utils/node.rb', line 41

def to_s
  "CliError: '#{@command}' rejected with message:\n'#{@clierror}'"
end