Exception: FinchAPI::Errors::APIError

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

Direct Known Subclasses

APIConnectionError, APIStatusError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of APIError.

Parameters:

  • url (URI::Generic)
  • status (Integer, nil) (defaults to: nil)
  • body (Object, nil) (defaults to: nil)
  • request (nil) (defaults to: nil)
  • response (nil) (defaults to: nil)
  • message (String, nil) (defaults to: nil)


32
33
34
35
36
37
38
39
# File 'lib/finch_api/errors.rb', line 32

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

Instance Attribute Details

#bodyObject?

Returns:

  • (Object, nil)


22
23
24
# File 'lib/finch_api/errors.rb', line 22

def body
  @body
end

#statusInteger?

Returns:

  • (Integer, nil)


19
20
21
# File 'lib/finch_api/errors.rb', line 19

def status
  @status
end

#urlURI::Generic

Returns:

  • (URI::Generic)


16
17
18
# File 'lib/finch_api/errors.rb', line 16

def url
  @url
end