Exception: CoreLibrary::ApiException

Inherits:
StandardError
  • Object
show all
Defined in:
lib/apimatic-core/types/sdk/api_exception.rb

Overview

Class for exceptions when there is a network error, status code error, etc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason, response) ⇒ ApiException

The constructor.

Parameters:

  • reason (String)

    The reason for raising an exception.

  • response (HttpResponse)

    The HttpResponse of the API call.



9
10
11
12
13
# File 'lib/apimatic-core/types/sdk/api_exception.rb', line 9

def initialize(reason, response)
  super(reason)
  @response = response
  @response_code = response.status_code
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



4
5
6
# File 'lib/apimatic-core/types/sdk/api_exception.rb', line 4

def response
  @response
end

#response_codeObject (readonly)

Returns the value of attribute response_code.



4
5
6
# File 'lib/apimatic-core/types/sdk/api_exception.rb', line 4

def response_code
  @response_code
end