Exception: Kaseya::BMS::BMSError

Inherits:
ApiError
  • Object
show all
Defined in:
lib/kaseya/bms/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject (readonly)

Returns the value of attribute description.



3
4
5
# File 'lib/kaseya/bms/exceptions.rb', line 3

def description
  @description
end

#errorObject (readonly)

Returns the value of attribute error.



3
4
5
# File 'lib/kaseya/bms/exceptions.rb', line 3

def error
  @error
end

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/kaseya/bms/exceptions.rb', line 3

def response
  @response
end