diff --git a/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php b/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php --- a/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php +++ b/src/applications/search/fulltextstorage/PhabricatorElasticFulltextStorageEngine.php @@ -303,7 +303,8 @@ $exceptions[] = $e; } } - throw new PhutilAggregateException('All search hosts failed:', $exceptions); + throw new PhutilAggregateException(pht('All Fulltext Search hosts failed:'), + $exceptions); } public function indexExists(PhabricatorElasticSearchHost $host = null) { diff --git a/src/infrastructure/cluster/search/PhabricatorSearchService.php b/src/infrastructure/cluster/search/PhabricatorSearchService.php --- a/src/infrastructure/cluster/search/PhabricatorSearchService.php +++ b/src/infrastructure/cluster/search/PhabricatorSearchService.php @@ -235,21 +235,20 @@ * @throws PhutilAggregateException */ public static function executeSearch(PhabricatorSavedQuery $query) { - $services = self::getAllServices(); $exceptions = array(); - foreach ($services as $service) { - $engine = $service->getEngine(); - // try all hosts until one succeeds + // try all services until one succeeds + foreach (self::getAllServices() as $service) { try { + $engine = $service->getEngine(); $res = $engine->executeSearch($query); - // return immediately if we get results without an exception + // return immediately if we get results return $res; } catch (Exception $ex) { $exceptions[] = $ex; } } - throw new PhutilAggregateException('All search engines failed:', - $exceptions); + $msg = pht('All of the configured Fulltext Search services failed.'); + throw new PhutilAggregateException($msg, $exceptions); } }