fix(record_too_big): Use content for hint in error display

This commit is contained in:
Pixelastic 2017-12-20 12:01:49 +01:00
parent 79ffa8ac4f
commit bf4db661ca
2 changed files with 5 additions and 2 deletions

View File

@ -17,6 +17,9 @@ module Jekyll
# context - A hash of values that will be passed from where the error
# happened to the display
def self.stop(error, context = {})
Logger.verbose("E:[jekyll-algolia] Raw error: #{error}")
Logger.verbose("E:[jekyll-algolia] Context: #{context}")
identified_error = identify(error, context)
if identified_error == false
@ -218,7 +221,7 @@ module Jekyll
'object_id' => object_id,
'object_title' => record[:title],
'object_url' => record[:url],
'object_hint' => record[:text][0..100],
'object_hint' => record[:content][0..100],
'nodes_to_index' => Configurator.algolia('nodes_to_index'),
'size' => size,
'size_limit' => '10 Kb'

View File

@ -192,7 +192,7 @@ describe(Jekyll::Algolia::ErrorHandler) do
title: 'Page title',
url: '/path/to/file.ext',
# rubocop:disable Metrics/LineLength
text: 'A very long text that is obviously too long to fit in one record, but that would be too long to actually display in the error message as wel so we will cut it at 100 characters.'
content: 'A very long text that is obviously too long to fit in one record, but that would be too long to actually display in the error message as wel so we will cut it at 100 characters.'
# rubocop:enable Metrics/LineLength
},
{ objectID: 'foo' }