Skip to content

Commit 947910b

Browse files
Merge pull request #345 from Flowpack/bugfix/response-is-an-object
BUGFIX: Trying to use response from exception as string
2 parents a9ec417 + 84bd9a5 commit 947910b

2 files changed

Lines changed: 3 additions & 2 deletions

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 {

Classes/Indexer/NodeIndexer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ public function indexNode(NodeInterface $node, $targetWorkspaceName = null)
219219
$this->logger->debug(sprintf('NodeIndexer (%s) - Property "%s" not indexed because no configuration found, node type %s.', $documentIdentifier, $propertyName, $node->getNodeType()->getName()), LogEnvironment::fromMethodName(__METHOD__));
220220
});
221221

222-
$document = new ElasticSearchDocument($mappingType,
222+
$document = new ElasticSearchDocument(
223+
$mappingType,
223224
$nodePropertiesToBeStoredInIndex,
224225
$documentIdentifier
225226
);

0 commit comments

Comments
 (0)