Exception: AnswerLayer::ApiError

Inherits:
Error
  • Object
show all
Defined in:
lib/answerlayer/errors.rb

Overview

HTTP API errors.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status:, body: nil, headers: nil) ⇒ ApiError

Returns a new instance of ApiError.



17
18
19
20
21
22
# File 'lib/answerlayer/errors.rb', line 17

def initialize(message, status:, body: nil, headers: nil)
  @status = status
  @body = body
  @headers = headers
  super(message)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



15
16
17
# File 'lib/answerlayer/errors.rb', line 15

def body
  @body
end

#headersObject (readonly)

Returns the value of attribute headers.



15
16
17
# File 'lib/answerlayer/errors.rb', line 15

def headers
  @headers
end

#statusObject (readonly)

Returns the value of attribute status.



15
16
17
# File 'lib/answerlayer/errors.rb', line 15

def status
  @status
end