Method: CoreLibrary::ResponseHandler#local_error

Defined in:
lib/apimatic-core/response_handler.rb

#local_error(error_code, error_message, exception_type) ⇒ ResponseHandler

Registers an entry with error message in the local errors hash.

Parameters:

  • error_code (String)

    The error code to check against.

  • error_message (String)

    The reason for the exception.

  • exception_type (ApiException)

    The type of the exception to raise.

Returns:



51
52
53
54
55
56
# File 'lib/apimatic-core/response_handler.rb', line 51

def local_error(error_code, error_message, exception_type)
  @local_errors[error_code.to_s] = ErrorCase.new
                                            .error_message(error_message)
                                            .exception_type(exception_type)
  self
end