Exception: Cadenya::APIResponseError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cadenya/core.rb

Overview

The server answered, but not with the JSON the API contract promises (e.g. an unfollowed redirect or a non-JSON success body).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(status_code, message, body: nil) ⇒ APIResponseError

Returns a new instance of APIResponseError.



35
36
37
38
39
# File 'lib/cadenya/core.rb', line 35

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



33
34
35
# File 'lib/cadenya/core.rb', line 33

def body
  @body
end

#status_codeObject (readonly)

Returns the value of attribute status_code.



33
34
35
# File 'lib/cadenya/core.rb', line 33

def status_code
  @status_code
end