Method: CoreLibrary::ResponseHandler#local_error_template

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

#local_error_template(error_code, error_message_template, exception_type) ⇒ ResponseHandler

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

Parameters:

  • error_code (String)

    The error code to check against.

  • error_message_template (String)

    The reason template for the exception.

  • exception_type (ApiException)

    The type of the exception to raise.

Returns:



63
64
65
66
67
68
# File 'lib/apimatic-core/response_handler.rb', line 63

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