Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Classes/UpdateAliasJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Neos\Flow\Annotations as Flow;
use Neos\Flow\Log\Utility\LogEnvironment;
use Neos\Flow\Utility\Algorithms;
use Psr\Http\Message\ResponseInterface;
use Psr\Log\LoggerInterface;

class UpdateAliasJob implements JobInterface
Expand Down Expand Up @@ -137,7 +138,7 @@ protected function cleanupOldIndices(): void
}
}
} catch (ApiException $exception) {
$response = json_decode($exception->getResponse(), true, 512, JSON_THROW_ON_ERROR);
$response = json_decode($exception->getResponse() instanceof ResponseInterface ? $exception->getResponse()->getBody()->__toString() : (string) $exception->getResponse(), true, 512, JSON_THROW_ON_ERROR);
if ($response->error instanceof \stdClass) {
$this->logger->error(sprintf('Old indices for alias %s could not be removed. ElasticSearch responded with status %s, saying "%s: %s"', $this->indexPostfix, $response->status, $response->error->type, $response->error->reason), LogEnvironment::fromMethodName(__METHOD__));
} else {
Expand Down