forward original query exception when querying by name fails
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
26a20ed13f
commit
3401be216d
|
@ -93,7 +93,12 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
|
|||
|
||||
if ($parameterType !== null && !$parameterType->isBuiltin()) {
|
||||
$resolveName = $parameter->getName();
|
||||
return $this->query($resolveName);
|
||||
try {
|
||||
return $this->query($resolveName);
|
||||
} catch (QueryException $e2) {
|
||||
// don't lose the error we got while trying to query by type
|
||||
throw new QueryException($e2->getMessage(), $e2->getCode(), $e);
|
||||
}
|
||||
}
|
||||
|
||||
throw $e;
|
||||
|
|
Loading…
Reference in New Issue