Skip to content

Commit

Permalink
TASK: Correctly communicate NodeTypeNotFound nodetype manager behav…
Browse files Browse the repository at this point in the history
…iour
  • Loading branch information
mhsdesign committed May 17, 2024
1 parent f4fe493 commit 95ad9f1
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

use Neos\ContentRepository\Core\SharedModel\Exception\NodeConfigurationException;
use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeIsFinalException;
use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFound;
use Neos\ContentRepository\Core\SharedModel\Node\NodeName;
use Neos\Utility\Arrays;
use Neos\Utility\Exception\PropertyNotAccessibleException;
Expand Down Expand Up @@ -106,8 +105,6 @@ public function getSubNodeTypes(string|NodeTypeName $superTypeName, bool $includ

/**
* Returns the specified node type (which could be abstract)
*
* @throws NodeTypeNotFound
*/
public function getNodeType(string|NodeTypeName $nodeTypeName): ?NodeType
{
Expand Down Expand Up @@ -242,7 +239,6 @@ public function isNodeTypeAllowedAsChildToTetheredNode(NodeTypeName $parentNodeT
* @param array<string,mixed> $completeNodeTypeConfiguration the full node type configuration for all node types
* @throws NodeConfigurationException
* @throws NodeTypeIsFinalException
* @throws NodeTypeNotFound
*/
private function loadNodeType(string $nodeTypeName, array &$completeNodeTypeConfiguration): NodeType
{
Expand All @@ -251,7 +247,8 @@ private function loadNodeType(string $nodeTypeName, array &$completeNodeTypeConf
}

if (!isset($completeNodeTypeConfiguration[$nodeTypeName])) {
throw new NodeTypeNotFound('Node type "' . $nodeTypeName . '" does not exist', 1316451800);
// only thrown if a programming error occurred.
throw new \RuntimeException('Must not happen, logic error: Node type "' . $nodeTypeName . '" does not exist', 1316451800);
}

$nodeTypeConfiguration = $completeNodeTypeConfiguration[$nodeTypeName];
Expand Down

0 comments on commit 95ad9f1

Please sign in to comment.