Class: AdpClient::InvalidRequestHandler

Inherits:
BaseErrorHandler show all
Defined in:
lib/adp_client.rb

Instance Method Summary collapse

Methods inherited from BaseErrorHandler

#call, #initialize

Constructor Details

This class inherits a constructor from AdpClient::BaseErrorHandler

Instance Method Details

#errorObject



260
261
262
263
264
265
266
# File 'lib/adp_client.rb', line 260

def error
  InvalidRequest.new(
    format('%<error>s: %<description>s',
           error: @httparty.parsed_response['error'],
           description: @httparty.parsed_response['error_description'])
  )
end

#fail?Boolean

Returns:

  • (Boolean)


268
269
270
271
# File 'lib/adp_client.rb', line 268

def fail?
  @httparty.parsed_response['error'] == 'invalid_request' &&
    @httparty.code == 400
end