bug #16799 Improve error message for undefined DIC aliases (mpdude)

This PR was squashed before being merged into the 2.3 branch (closes #16799).

Discussion
----------

Improve error message for undefined DIC aliases

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        | n/a

Additionally, I think the arguments need to be the other way round (`templating` is an alias pointing to `templating.engine.twig`).

Commits
-------

9195cd3 Improve error message for undefined DIC aliases
This commit is contained in:
Christophe Coevoet 2015-12-05 11:09:09 +01:00
commit fbc353dcda
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ class ReplaceAliasByActualDefinitionPass implements CompilerPassInterface
try {
$definition = $container->getDefinition($aliasId);
} catch (InvalidArgumentException $e) {
throw new InvalidArgumentException(sprintf('Unable to replace alias "%s" with "%s".', $alias, $id), null, $e);
throw new InvalidArgumentException(sprintf('Unable to replace alias "%s" with actual definition "%s".', $id, $alias), null, $e);
}
if ($definition->isPublic()) {