@@ -452,15 +452,15 @@ public function cleanupCommand(): void
452452 foreach ($ combinations as $ dimensionsValues ) {
453453 try {
454454 $ this ->nodeIndexer ->setDimensions ($ dimensionsValues );
455- $ indicesToBeRemoved = $ this ->nodeIndexer ->removeOldIndices ();
456- if (count ($ indicesToBeRemoved ) > 0 ) {
457- foreach ($ indicesToBeRemoved as $ indexToBeRemoved ) {
458- $ removed = true ;
459- $ this ->logger ->info ('Removing old index ' . $ indexToBeRemoved , LogEnvironment::fromMethodName (__METHOD__ ));
460- }
455+ $ removedIndices = $ this ->nodeIndexer ->removeOldIndices ();
456+
457+ foreach ($ removedIndices as $ indexToBeRemoved ) {
458+ $ removed = true ;
459+ $ this ->logger ->info ('Removing old index ' . $ indexToBeRemoved , LogEnvironment::fromMethodName (__METHOD__ ));
461460 }
462461 } catch (ApiException $ exception ) {
463- $ response = json_decode ($ exception ->getResponse (), false );
462+ $ exception ->getResponse ()->getBody ()->rewind ();
463+ $ response = json_decode ($ exception ->getResponse ()->getBody ()->getContents (), false );
464464 $ message = sprintf ('Nothing removed. ElasticSearch responded with status %s ' , $ response ->status );
465465
466466 if (isset ($ response ->error ->type )) {
@@ -548,6 +548,7 @@ private function createContentContext(string $workspaceName, array $dimensions =
548548 * @return void
549549 * @throws \Flowpack\ElasticSearch\ContentRepositoryAdaptor\Exception
550550 * @throws \Flowpack\ElasticSearch\Exception
551+ * @throws \Neos\Flow\Http\Exception
551552 */
552553 private function applyMapping (): void
553554 {
0 commit comments