module Jekyll::Algolia::ErrorHandler

def self.invalid_credentials_for_tmp_index?(error, _context = {})

that.
not have access to the _tmp indices and the error message will reflect
If the error happens on a _tmp folder, it might mean that the key does

_context - Not used

Public: Check if credentials specifically can't access the _tmp index
def self.invalid_credentials_for_tmp_index?(error, _context = {})
  details = error_hash(error.message)
  index_name_tmp = details['index_name']
  if details['message'] != 'Index not allowed with this API key' ||
     index_name_tmp !~ /_tmp$/
    return false
  end
  {
    'application_id' => Configurator.application_id,
    'index_name' => Configurator.index_name,
    'index_name_tmp' => index_name_tmp
  }
end