Skip to content

Commit 1c0de91

Browse files
insekticidsoyuka
authored andcommitted
fix(elasticsearch): skip metadata without ES nodes
fixes #4912
1 parent 9f58d10 commit 1c0de91

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
@@ -12,6 +12,7 @@
1212
* Metadata: exception to status on operations (#4861)
1313
* Serializer: adds the JSON_INVALID_UTF8_IGNORE flag to JsonEncode (#4741)
1414
* Symfony: autoconfigure legacy Doctrine extensions (#4909)
15+
* Elasticsearch: skip metadata without ES nodes (#4913)
1516

1617
Various cs fixes and PHPDoc to help upgrading to 3.0.
1718

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
{
@@ -88,6 +89,8 @@ private function hasIndices(string $shortName): bool
8889
return true;
8990
} catch (Missing404Exception) {
9091
return false;
92+
} catch (NoNodesAvailableException) {
93+
return false;
9194
}
9295
}
9396
}

0 commit comments

Comments
 (0)