Exception: HaloMspApi::APIError

Inherits:
Error
  • Object
show all
Defined in:
lib/halo_msp_api/error.rb

Overview

Class for handling API Errors

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status_code: nil, response_body: nil) ⇒ APIError

Returns a new instance of APIError.



20
21
22
23
24
# File 'lib/halo_msp_api/error.rb', line 20

def initialize(message, status_code: nil, response_body: nil)
  super(message)
  @status_code = status_code
  @response_body = response_body
end

Instance Attribute Details

#response_bodyObject (readonly)

Returns the value of attribute response_body.



18
19
20
# File 'lib/halo_msp_api/error.rb', line 18

def response_body
  @response_body
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



18
19
20
# File 'lib/halo_msp_api/error.rb', line 18

def status_code
  @status_code
end