Exception: Kaseya::BMS::BMSError
- Defined in:
- lib/kaseya/bms/exceptions.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ BMSError
constructor
A new instance of BMSError.
Constructor Details
#initialize(response) ⇒ BMSError
Returns a new instance of BMSError.
5 6 7 8 9 10 11 12 13 |
# File 'lib/kaseya/bms/exceptions.rb', line 5 def initialize(response) @response = response if @response&.body @error = @response.body["error"] @description = @response.body["error_description"] end super("#{@error || 'Error'}: #{@description || 'Unknown API error'}") end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/kaseya/bms/exceptions.rb', line 3 def description @description end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
3 4 5 |
# File 'lib/kaseya/bms/exceptions.rb', line 3 def error @error end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/kaseya/bms/exceptions.rb', line 3 def response @response end |