Skip to content

Commit 99293fc

Browse files
insekticidsoyuka
authored andcommitted
fix(elasticsearch): skip metadata without ES nodes
fixes #4912
1 parent 72ed622 commit 99293fc

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Metadata: exception to status on operations (#4861)
88
* Serializer: adds the JSON_INVALID_UTF8_IGNORE flag to JsonEncode (#4741)
99
* Symfony: autoconfigure legacy Doctrine extensions (#4909)
10+
* Elasticsearch: skip metadata without ES nodes (#4913)
1011

1112
Various cs fixes and PHPDoc to help upgrading to 3.0.
1213

src/Elasticsearch/Metadata/Resource/Factory/ElasticsearchProviderResourceMetadataCollectionFactory.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use ApiPlatform\Util\Inflector;
2222
use Elasticsearch\Client;
2323
use Elasticsearch\Common\Exceptions\Missing404Exception;
24+
use Elasticsearch\Common\Exceptions\NoNodesAvailableException;
2425

2526
final class ElasticsearchProviderResourceMetadataCollectionFactory implements ResourceMetadataCollectionFactoryInterface
2627
{
@@ -97,6 +98,8 @@ private function hasIndices(string $shortName): bool
9798
return true;
9899
} catch (Missing404Exception $e) {
99100
return false;
101+
} catch (NoNodesAvailableException) {
102+
return false;
100103
}
101104
}
102105
}

0 commit comments

Comments
 (0)