File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed
AdvancedSearch/Model/Client
Elasticsearch8/SearchAdapter
Elasticsearch/ElasticAdapter/SearchAdapter Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 77
88namespace Magento \AdvancedSearch \Model \Client ;
99
10- class ClientException extends \Exception
10+ use Magento \Framework \Exception \LocalizedException ;
11+
12+ class ClientException extends LocalizedException
1113{
1214
1315}
Original file line number Diff line number Diff line change @@ -83,6 +83,7 @@ public function __construct(
8383 *
8484 * @param RequestInterface $request
8585 * @return QueryResponse
86+ * @throws ClientException
8687 */
8788 public function query (RequestInterface $ request )
8889 {
@@ -95,7 +96,7 @@ public function query(RequestInterface $request)
9596 $ rawResponse = $ client ->query ($ query );
9697 } catch (\Exception $ e ) {
9798 $ this ->logger ->critical ($ e );
98- throw new ClientException (__ ($ e -> getMessage () ), $ e ->getCode (), $ e );
99+ throw new ClientException (__ (" Could not perform search query. " ), $ e ->getCode (), $ e );
99100 }
100101
101102 $ rawDocuments = isset ($ rawResponse ['hits ' ]['hits ' ]) ? $ rawResponse ['hits ' ]['hits ' ] : [];
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ public function query(RequestInterface $request): QueryResponse
9898 $ rawResponse = $ client ->query ($ query );
9999 } catch (\Exception $ e ) {
100100 $ this ->logger ->critical ($ e );
101- throw new ClientException ($ e -> getMessage ( ), $ e ->getCode (), $ e );
101+ throw new ClientException (__ ( " Could not perform search query. " ), $ e ->getCode (), $ e );
102102 }
103103
104104 $ rawDocuments = $ rawResponse ['hits ' ]['hits ' ] ?? [];
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ public function query(RequestInterface $request) : QueryResponse
138138 );
139139 } catch (\Exception $ e ) {
140140 $ this ->logger ->critical ($ e );
141- throw new ClientException ($ e -> getMessage ( ), $ e ->getCode (), $ e );
141+ throw new ClientException (__ ( " Could not perform search query. " ), $ e ->getCode (), $ e );
142142 } finally {
143143 if (isset ($ pitId )) {
144144 $ client ->closePointInTime (['body ' => ['pit_id ' => [$ pitId ]]]);
You can’t perform that action at this time.
0 commit comments