Improve dependency injection error message

Change from display the name of the parameter to the type of the
parameter. This is that in most cases is usefull.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
Carl Schwan 2022-12-01 12:46:01 +01:00
parent 5f3585d817
commit 2a864ec13c

View file

@ -108,7 +108,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer {
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(), (int) $e2->getCode(), $e);
throw new QueryException($e->getMessage(), (int) $e->getCode(), $e);
}
}