Exception: LMRest::APIError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/lm_rest/api_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ APIError

Returns a new instance of APIError.



14
15
16
17
18
19
20
# File 'lib/lm_rest/api_client.rb', line 14

def initialize(response)
  @status = response.code
  @body = response.body
  @headers = response.headers

  super("LogicMonitor API request failed with status #{@status}")
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



12
13
14
# File 'lib/lm_rest/api_client.rb', line 12

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



12
13
14
# File 'lib/lm_rest/api_client.rb', line 12

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



12
13
14
# File 'lib/lm_rest/api_client.rb', line 12

def status
  @status
end