module Jekyll::Algolia::ErrorHandler
def self.unknown_settings?(error, context = {})
not available. We'll tell the user which one so they can fix their
The API will block any call that tries to update a setting value that is
context[:settings] - The settings passed to update the index
Public: Check if one of the index settings is invalid
def self.unknown_settings?(error, context = {}) details = error_hash(error.message) message = details['message'] return false if message !~ /^Invalid object attributes.*/ # Getting the unknown setting name regex = /^Invalid object attributes: (.*) near line.*/ setting_name, = regex.match(message).captures setting_value = context[:settings][setting_name] { 'setting_name' => setting_name, 'setting_value' => setting_value } end