Skip to content

Commit 2e27dcd

Browse files
committed
ACP2E-3892: [Mainline] Unpopulated pages are cached due to search engine errors
1 parent 75ddc6c commit 2e27dcd

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

app/code/Magento/AdvancedSearch/Model/Client/ClientException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77

88
namespace Magento\AdvancedSearch\Model\Client;
99

10-
use Magento\Framework\Exception\LocalizedException;
11-
12-
class ClientException extends LocalizedException
10+
class ClientException extends \Exception
1311
{
1412

1513
}

app/code/Magento/CatalogGraphQl/Model/Resolver/Layer/DataProvider/Filters.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function getData(string $layerType, ?array $attributesToFilter = null) :
8181
* @return bool
8282
* @throws LocalizedException
8383
*/
84-
private function isNeedToAddFilter(AbstractFilter $filter, ?array $attributesToFilter): bool
84+
private function isNeedToAddFilter(AbstractFilter $filter, ?array $attributesToFilter = null): bool
8585
{
8686
if ($attributesToFilter === null) {
8787
$result = (bool)$filter->getItemsCount();

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/Query/Search.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Magento\Framework\GraphQl\Exception\GraphQlInputException;
1818
use Magento\Framework\GraphQl\Query\Resolver\ArgumentsProcessorInterface;
1919
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
20-
use Magento\Framework\Search\Request\EmptyRequestDataException;
2120
use Magento\GraphQl\Model\Query\ContextInterface;
2221
use Magento\Search\Api\SearchInterface;
2322

@@ -155,9 +154,7 @@ public function getResult(
155154
'suggestions' => $suggestions,
156155
]
157156
);
158-
} catch (GraphQlInputException $e) {
159-
throw $e;
160-
} catch (\InvalidArgumentException|EmptyRequestDataException|ClientException) {
157+
} catch (\InvalidArgumentException|ClientException) {
161158
return $this->searchResultFactory->create(
162159
[
163160
'totalCount' => 0,

app/code/Magento/OpenSearch/SearchAdapter/Adapter.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,10 @@ public function query(RequestInterface $request) : QueryResponse
133133
$rawResponse = $client->query($query);
134134
} catch (Missing404Exception|BadRequest400Exception $e) {
135135
$this->logger->critical($e);
136-
throw new EmptyRequestDataException(
137-
(new Phrase("Could not perform search query."))->render()
138-
);
136+
throw new EmptyRequestDataException("Could not perform search query.");
139137
} catch (\Exception $e) {
140138
$this->logger->critical($e);
141-
throw new ClientException(__("Could not perform search query."), $e->getCode(), $e);
139+
throw new ClientException("Could not perform search query.", $e->getCode(), $e);
142140
} finally {
143141
if (isset($pitId)) {
144142
$client->closePointInTime(['body' => ['pit_id' => [$pitId]]]);

app/code/Magento/OpenSearch/i18n/en_US.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@
77
"OpenSearch HTTP Username","OpenSearch HTTP Username"
88
"OpenSearch HTTP Password","OpenSearch HTTP Password"
99
"OpenSearch Server Timeout","OpenSearch Server Timeout"
10-
"Could not perform search query.","Could not perform search query."

0 commit comments

Comments
 (0)