Exception: Cisco::CliError
- Inherits:
-
RequestFailed
- Object
- RuntimeError
- CiscoError
- RequestFailed
- Cisco::CliError
- Defined in:
- lib/cisco_node_utils/exceptions.rb
Overview
Extension of RequestFailed class specifically for CLI errors
Instance Attribute Summary
Attributes inherited from CiscoError
Instance Method Summary collapse
-
#initialize(message = nil, clierror: nil, rejected_input: nil, successful_input: [], **kwargs) ⇒ CliError
constructor
A new instance of CliError.
Methods inherited from CiscoError
Constructor Details
#initialize(message = nil, clierror: nil, rejected_input: nil, successful_input: [], **kwargs) ⇒ CliError
Returns a new instance of CliError.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cisco_node_utils/exceptions.rb', line 65 def initialize(=nil, clierror: nil, rejected_input: nil, successful_input: [], **kwargs) unless if rejected_input.is_a?(Array) if rejected_input.length > 1 = "The following commands were rejected:\n" += " #{rejected_input.join("\n ")}\n" else = "The command '#{rejected_input.first}' was rejected " end else = "The command '#{rejected_input}' was rejected " end += "with error:\n#{clierror}" end super(, :clierror => clierror, :rejected_input => rejected_input, :successful_input => successful_input, **kwargs) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Cisco::CiscoError