Skip to content

Commit fd26dbb

Browse files
authored
BUGFIX: Trying to use response from exception as string
The return value of `ApiException->getResponse()` is no longer a string, so decoding it as JSON fails.
1 parent a9ec417 commit fd26dbb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Classes/Command/NodeIndexCommandController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ public function cleanupCommand(): void
320320
$this->logger->info('Nothing to remove.', LogEnvironment::fromMethodName(__METHOD__));
321321
}
322322
} catch (ApiException $exception) {
323-
$response = json_decode($exception->getResponse());
323+
$response = json_decode($exception->getResponse()->getBody()->getContents());
324324
if ($response->error instanceof \stdClass) {
325325
$this->logger->info(sprintf('Nothing removed. ElasticSearch responded with status %s, saying "%s: %s"', $response->status, $response->error->type, $response->error->reason), LogEnvironment::fromMethodName(__METHOD__));
326326
} else {

0 commit comments

Comments
 (0)