From 51ceab16c95efc5527445788cb83f0289675d0bf Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Fri, 22 May 2026 12:00:28 +0300 Subject: E6-E8: Apply code-quality fixes from review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove dead $fields assignment in buildSpec() (copy-paste artifact from bundled engine; never actually used). - Revert executeSearch catch from Throwable back to Exception. The earlier lint-driven widening was over-broad: Error subclasses (TypeError, etc.) should propagate immediately, not be aggregated into the per-host failover loop. Comment added explaining the intent. 🤖 Generated by [robots](https://vyos.io) --- src/engine/VyOSElasticModernFulltextStorageEngine.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/engine/VyOSElasticModernFulltextStorageEngine.php') diff --git a/src/engine/VyOSElasticModernFulltextStorageEngine.php b/src/engine/VyOSElasticModernFulltextStorageEngine.php index 199f2c8..c49ff5e 100644 --- a/src/engine/VyOSElasticModernFulltextStorageEngine.php +++ b/src/engine/VyOSElasticModernFulltextStorageEngine.php @@ -296,7 +296,12 @@ abstract class VyOSElasticModernFulltextStorageEngine $response = $this->executeRequest($host, $uri, $spec); $phids = ipull($response['hits']['hits'], '_id'); return $phids; - } catch (Throwable $e) { + } catch (Exception $e) { + // Catches HTTPFutureResponseStatus and other network/HTTP exceptions + // raised by executeRequest(). PHP Error subclasses (TypeError, etc.) + // are intentionally NOT caught -- they indicate programming bugs that + // should propagate immediately, not get aggregated into the per-host + // failover. $exceptions[] = $e; } } @@ -309,7 +314,6 @@ abstract class VyOSElasticModernFulltextStorageEngine $q = new PhabricatorElasticsearchQueryBuilder(); $query_string = $query->getParameter('query'); if (strlen($query_string)) { - $fields = $this->getTypeConstants('PhabricatorSearchDocumentFieldType'); $q->addMustClause(array( 'simple_query_string' => array( 'query' => $query_string, -- cgit v1.2.3