module Jekyll::Algolia::ErrorHandler
def self.unknown_application_id?(error, _context = {})
is invalid. As we cannot actually contact the server, the error is raw
If the call to the cluster fails, chances are that the application ID
_context - Not used
Public: Check if the application id is available
def self.unknown_application_id?(error, _context = {}) message = error.message return false if message !~ /^Cannot reach any host/ matches = /.*\((.*)\.algolia.net.*/.match(message) # The API will browse on APP_ID-dsn, but push/delete on APP_ID only # We need to catch both potential errors app_id = matches[1].gsub(/-dsn$/, '') { 'application_id' => app_id } end