Skip to content

Commit b8e9d21

Browse files
committed
refactor(reflection): improve type resolution error message
1 parent 407fb5c commit b8e9d21

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/reflection/src/TypeReflector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ private function resolveDefinition(PHPReflector|PHPReflectionType|string $reflec
263263
));
264264
}
265265

266-
throw new Exception('Could not resolve type');
266+
throw new \InvalidArgumentException(
267+
sprintf('Could not resolve type for reflector of type: %s', get_debug_type($reflector))
268+
);
267269
}
268270

269271
private function resolveIsNullable(PHPReflectionType|PHPReflector|string $reflector): bool

0 commit comments

Comments
 (0)