Exception: Doohly::APIError

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

Overview

Raised when API request fails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, status: nil, body: nil, response: nil) ⇒ APIError

Returns a new instance of APIError.



11
12
13
14
15
16
# File 'lib/doohly/error.rb', line 11

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

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



9
10
11
# File 'lib/doohly/error.rb', line 9

def body
  @body
end

#responseObject (readonly)

Returns the value of attribute response.



9
10
11
# File 'lib/doohly/error.rb', line 9

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



9
10
11
# File 'lib/doohly/error.rb', line 9

def status
  @status
end