Method: CoreLibrary::ApiException#initialize

Defined in:
lib/apimatic-core/types/sdk/api_exception.rb

#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