Method: SuggestGrid::APIException#initialize

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

#initialize(reason, context) ⇒ APIException

The constructor.

Parameters:

  • The (String)

    reason for raising an exception

  • The (HttpContext)

    HttpContext of the API call.



10
11
12
13
14
# File 'lib/suggest_grid/exceptions/api_exception.rb', line 10

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