Skip to content
Snippets Groups Projects
Commit 0d79c563 authored by Raimonds's avatar Raimonds
Browse files

Issue #3402379 by eelkeblok, maijs: Connection failure will crash the status report

parent 592ff04d
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
* Installation functions for the Elasticsearch Helper module.
*/
use Elasticsearch\Common\Exceptions\ElasticsearchException;
use Elasticsearch\Common\Exceptions\NoNodesAvailableException;
use Drupal\user\Entity\Role;
......@@ -56,7 +57,14 @@ function elasticsearch_helper_requirements($phase) {
catch (NoNodesAvailableException $e) {
$requirements['elasticsearch_health'] = [
'title' => t('Elasticsearch status'),
'description' => t('Could not connect to Elasticsearch'),
'description' => t('No nodes available.'),
'severity' => REQUIREMENT_ERROR,
];
}
catch (ElasticsearchException $e) {
$requirements['elasticsearch_health'] = [
'title' => t('Elasticsearch status'),
'description' => t('Could not connect to Elasticsearch. Return code %code.', ['%code' => $e->getCode()]),
'severity' => REQUIREMENT_ERROR,
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment