Exception: Cisco::YangError
- Inherits:
-
RequestFailed
- Object
- RuntimeError
- CiscoError
- RequestFailed
- Cisco::YangError
- Defined in:
- lib/cisco_node_utils/exceptions.rb
Overview
Extension of RequestFailed class specifically for YANG errors
Instance Attribute Summary
Attributes inherited from CiscoError
Instance Method Summary collapse
-
#initialize(message = nil, error: nil, rejected_input: nil, successful_input: [], **kwargs) ⇒ YangError
constructor
A new instance of YangError.
Methods inherited from CiscoError
Constructor Details
#initialize(message = nil, error: nil, rejected_input: nil, successful_input: [], **kwargs) ⇒ YangError
Returns a new instance of YangError.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/cisco_node_utils/exceptions.rb', line 93 def initialize(=nil, error: nil, rejected_input: nil, successful_input: [], **kwargs) unless if rejected_input.is_a?(Array) if rejected_input.length > 1 = "The following configs were rejected:\n" += " #{rejected_input.join("\n ")}\n" else = "The config '#{rejected_input.first}' was rejected " end else = "The config '#{rejected_input}' was rejected " end += "with error:\n#{error}" end super(, :error => error, :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