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