Exception: Cisco::CliError
- Inherits:
-
RuntimeError
- Object
- RuntimeError
- Cisco::CliError
- 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
-
#clierror ⇒ Object
readonly
Returns the value of attribute clierror.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#previous ⇒ Object
readonly
Returns the value of attribute previous.
Instance Method Summary collapse
-
#initialize(command, clierror, previous) ⇒ CliError
constructor
A new instance of CliError.
- #to_s ⇒ Object
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
#clierror ⇒ Object (readonly)
Returns the value of attribute clierror.
34 35 36 |
# File 'lib/cisco_node_utils/node.rb', line 34 def clierror @clierror end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
34 35 36 |
# File 'lib/cisco_node_utils/node.rb', line 34 def command @command end |
#previous ⇒ Object (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_s ⇒ Object
41 42 43 |
# File 'lib/cisco_node_utils/node.rb', line 41 def to_s "CliError: '#{@command}' rejected with message:\n'#{@clierror}'" end |