From c7f0c0e53a4a418fc50aacec9cf93105012282cc Mon Sep 17 00:00:00 2001 From: Wouter Samaey Date: Fri, 25 Feb 2022 14:57:01 +0100 Subject: [PATCH] Let ES exceptions surface instead of showing no products --- app/code/Magento/Elasticsearch7/SearchAdapter/Adapter.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/code/Magento/Elasticsearch7/SearchAdapter/Adapter.php b/app/code/Magento/Elasticsearch7/SearchAdapter/Adapter.php index bbc7985f4519d..b4ce19d5c81a0 100644 --- a/app/code/Magento/Elasticsearch7/SearchAdapter/Adapter.php +++ b/app/code/Magento/Elasticsearch7/SearchAdapter/Adapter.php @@ -113,13 +113,7 @@ public function query(RequestInterface $request) : QueryResponse $query = $this->mapper->buildQuery($request); $aggregationBuilder->setQuery($this->queryContainerFactory->create(['query' => $query])); - try { - $rawResponse = $client->query($query); - } catch (\Exception $e) { - $this->logger->critical($e); - // return empty search result in case an exception is thrown from Elasticsearch - $rawResponse = self::$emptyRawResponse; - } + $rawResponse = $client->query($query); $rawDocuments = $rawResponse['hits']['hits'] ?? []; $queryResponse = $this->responseFactory->create(