Follow up 8c5f87c9d4: Improved detection of ES attachment plugin error and output message.

This commit is contained in:
Thorsten Eckel 2018-04-03 11:27:58 +02:00
parent 525de8413c
commit 7954ee0dce

View file

@ -606,12 +606,12 @@ return true if backend is configured
message = if response&.error&.match?('Connection refused')
"Elasticsearch is not reachable, probably because it's not running or even installed."
elsif url.end_with?('pipeline/zammad-attachment') && response.code == 400
elsif url.end_with?('pipeline/zammad-attachment', 'pipeline=zammad-attachment') && response.code == 400
'The installed attachment plugin could not handle the request payload. Ensure that the correct attachment plugin is installed (5.6 => ingest-attachment, 2.4 - 5.5 => mapper-attachments).'
else
'Check the response and payload for detailed information: '
end
"#{prefix}#{message}#{suffix}"
"#{prefix} #{message}#{suffix}"
end
end