Skip to content

Commit

Permalink
Merge pull request #311 from nextcloud/backport/308/stable27
Browse files Browse the repository at this point in the history
[stable27] PlatformTemporaryException
  • Loading branch information
ArtificialOwl committed Sep 25, 2023
2 parents c3cab2a + 94f5c33 commit d951870
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Platform/ElasticSearchPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

use Elastic\Elasticsearch\Client;
use Elastic\Elasticsearch\ClientBuilder;
use Elastic\Transport\Exception\NoNodeAvailableException;
use Exception;
use InvalidArgumentException;
use OCA\FullTextSearch_Elasticsearch\Exceptions\AccessIsEmptyException;
Expand Down Expand Up @@ -186,8 +187,6 @@ public function resetIndex(string $providerId) {
*/
public function indexDocument(IIndexDocument $document): IIndex {
$document->initHash();

$index = null;
try {
$result = $this->indexService->indexDocument($this->getClient(), $document);
$index = $this->indexService->parseIndexResult($document->getIndex(), $result);
Expand All @@ -198,6 +197,9 @@ public function indexDocument(IIndexDocument $document): IIndex {
);

return $index;
} catch (NoNodeAvailableException $e) {
// replace with \OCP\FullTextSearch\Exceptions\PlatformTemporaryException for version 28.
throw new \OCA\FullTextSearch\Exceptions\PlatformTemporaryException();
} catch (Exception $e) {
$this->manageIndexErrorException($document, $e);
}
Expand Down

0 comments on commit d951870

Please sign in to comment.