Skip to content

Commit 251fe67

Browse files
committed
Update exception messages
1 parent e5288dd commit 251fe67

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Factory/Reflection/ReflectionMethodFactory.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ protected function addParamAnnotation($name, $value) : void
152152

153153
if (!$this->parameters->containsKey($param))
154154
{
155-
throw new \Exception();
155+
throw new \Exception
156+
(
157+
'Tried to set param annotation for non existant '
158+
. 'parameter: ' . $param
159+
);
156160
}
157161

158162
$comparator = new TypeComparator();
@@ -162,7 +166,7 @@ protected function addParamAnnotation($name, $value) : void
162166

163167
if (!$comparator->compatible($nativeType, $type))
164168
{
165-
throw new \Exception();
169+
throw new \Exception('Types are incompatible');
166170
}
167171

168172
$param->setRawValue('type', $type);

0 commit comments

Comments
 (0)