Class: AdpClient::ErrorHandler

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



231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/adp_client.rb', line 231

def error
  Error.new(
    @httparty
      .parsed_response
      .fetch('confirmMessage', {})
      .fetch('resourceMessages', [{}])[0]
      .fetch('processMessages', [{}])[0]
      .fetch('userMessage', {})
      .fetch('messageTxt', 'No userMessage messageTxt found'),
    @httparty.parsed_response
  )
end

#fail?Boolean

Returns:

  • (Boolean)


244
245
246
# File 'lib/adp_client.rb', line 244

def fail?
  @httparty.code == 500
end