module Jekyll::Algolia::ErrorHandler

def self.identify(error, context = {})

further identifying the issue.
that matches. Returns false if no match, or a hash of :name and :details
It will parse in order all potential known issues until it finds one

code intercepting the user
context - A hash of additional information that can be passed from the
error - The caught error

Public: Will identify the error and return its internal name
def self.identify(error, context = {})
  known_errors = %w[
    unknown_application_id
    invalid_credentials
    record_too_big
    unknown_settings
    invalid_index_name
  ]
  # Checking the errors against our known list
  known_errors.each do |potential_error|
    error_check = send("#{potential_error}?", error, context)
    next if error_check == false
    return {
      name: potential_error,
      details: error_check
    }
  end
  false
end