Skip to content

Commit

Permalink
TASK: Improve error message if site entity exists but no cr
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Feb 16, 2024
1 parent ba59c62 commit d8d36ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private function fetchSingle(string $where, array $parameters): DocumentNodeInfo
);
} catch (DBALException $e) {
throw new \RuntimeException(sprintf(
'Failed to load node for query "%s": %s',
'Failed to fetch a node, please ensure the projection is setup. Query "%s". %s',
$where,
$e->getMessage()
), 1599664746, $e);
Expand Down Expand Up @@ -273,7 +273,7 @@ private function fetchMultiple(string $where, array $parameters): DocumentNodeIn
);
} catch (DBALException $e) {
throw new \RuntimeException(sprintf(
'Failed to load node for query "%s": %s',
'Failed to fetch multiple nodes, please ensure the projection is setup. Query "%s". %s',
$where,
$e->getMessage()
), 1683808640, $e);
Expand Down Expand Up @@ -314,7 +314,7 @@ public function disableCache(): void
public function getDescendantsOfNode(DocumentNodeInfo $node): DocumentNodeInfos
{
return $this->fetchMultiple(
'dimensionSpacePointHash = :dimensionSpacePointHash
'dimensionSpacePointHash = :dimensionSpacePointHash
AND nodeAggregateIdPath LIKE :childNodeAggregateIdPathPrefix',
[
'dimensionSpacePointHash' => $node->getDimensionSpacePointHash(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
return $handler->handle($request);
}

// doctrine is running and we could fetch a site. This makes no promise if the content repository is set up.
$siteDetectionResult = SiteDetectionResult::create($site->getNodeName(), $site->getConfiguration()->contentRepositoryId);
return $handler->handle($siteDetectionResult->storeInRequest($request));
}
Expand Down

0 comments on commit d8d36ef

Please sign in to comment.