Skip to content

Commit

Permalink
Describe DescriptorNotRegisteredException
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Jul 3, 2024
1 parent c87ee29 commit d453424
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Type/Doctrine/DefaultDescriptorRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ public function get(string $type): DoctrineTypeDescriptor
{
$typesMap = Type::getTypesMap();
if (!isset($typesMap[$type])) {
throw new DescriptorNotRegisteredException();
throw new DescriptorNotRegisteredException($type);
}

/** @var class-string<Type> $typeClass */
$typeClass = $typesMap[$type];
if (!isset($this->descriptors[$typeClass])) {
throw new DescriptorNotRegisteredException();
throw new DescriptorNotRegisteredException($typeClass);
}
return $this->descriptors[$typeClass];
}
Expand All @@ -42,7 +42,7 @@ public function get(string $type): DoctrineTypeDescriptor
public function getByClassName(string $className): DoctrineTypeDescriptor
{
if (!isset($this->descriptors[$className])) {
throw new DescriptorNotRegisteredException();
throw new DescriptorNotRegisteredException($className);
}
return $this->descriptors[$className];
}
Expand Down

0 comments on commit d453424

Please sign in to comment.