Method: Bandwidth::APIException#initialize

Defined in:
lib/bandwidth/exceptions/api_exception.rb

#initialize(reason, response) ⇒ APIException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception.

  • The (HttpResponse)

    HttpReponse of the API call.



14
15
16
17
18
# File 'lib/bandwidth/exceptions/api_exception.rb', line 14

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