Exception: Moxml::AdapterError
- Defined in:
- lib/moxml/error.rb
Overview
Error raised when adapter operations fail
Instance Attribute Summary collapse
-
#adapter_name ⇒ Object
readonly
Returns the value of attribute adapter_name.
-
#native_error ⇒ Object
readonly
Returns the value of attribute native_error.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
Instance Method Summary collapse
-
#initialize(message, adapter: nil, operation: nil, native_error: nil) ⇒ AdapterError
constructor
A new instance of AdapterError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, adapter: nil, operation: nil, native_error: nil) ⇒ AdapterError
Returns a new instance of AdapterError.
90 91 92 93 94 95 |
# File 'lib/moxml/error.rb', line 90 def initialize(, adapter: nil, operation: nil, native_error: nil) @adapter_name = adapter @operation = operation @native_error = native_error super() end |
Instance Attribute Details
#adapter_name ⇒ Object (readonly)
Returns the value of attribute adapter_name.
88 89 90 |
# File 'lib/moxml/error.rb', line 88 def adapter_name @adapter_name end |
#native_error ⇒ Object (readonly)
Returns the value of attribute native_error.
88 89 90 |
# File 'lib/moxml/error.rb', line 88 def native_error @native_error end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
88 89 90 |
# File 'lib/moxml/error.rb', line 88 def operation @operation end |
Instance Method Details
#to_s ⇒ Object
97 98 99 100 101 102 103 104 105 106 |
# File 'lib/moxml/error.rb', line 97 def to_s msg = super msg += "\n Adapter: #{@adapter_name}" if @adapter_name msg += "\n Operation: #{@operation}" if @operation if @native_error msg += "\n Native Error: #{@native_error.class.name}: #{@native_error.}" end msg += "\n Hint: Ensure the adapter gem is properly installed and compatible" msg end |