<table role="table">
<thead>
<tr>
<th>Q</th>
<th>A</th>
</tr>
</thead>
<tbody>
<tr>
<td>Bug report?</td>
<td>yes</td>
</tr>
<tr>
<td>Feature request?</td>
<td>yes</td>
</tr>
<tr>
<td>BC Break report?</td>
<td>no</td>
</tr>
<tr>
<td>RFC?</td>
<td>no</td>
</tr>
<tr>
<td>Symfony version</td>
<td>4.1.0</td>
</tr>
</tbody>
</table>
<blockquote>
<p dir="auto">Sorry if this is a duplicate - I THOUGHT I opened this issue already, but cannot find it.</p>
</blockquote>
<p dir="auto">When autowiring a controller argument fails (e.g. no service exists to match the type-hint), you see a very generic message:</p>
<blockquote>
<p dir="auto">Controller "App\Controller\LiftController::indexAction()" requires that you provide a value for the "$foo" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one.</p>
</blockquote>
<p dir="auto">But, if this argument is not provided due to some autowiring error, the system, the error could/should report that instead - e.g.:</p>
<blockquote>
<p dir="auto">Cannot autowire service "App\Controller\BarController": argument "$foo" of method "indexAction()" has type "App\Controller\Foo" but this class was not found.</p>
</blockquote>
<p dir="auto">This is non-trivial, as the autowiring errors would need to be <em>stored</em>, and the argument resolver system would need some new way of reporting <em>why</em> the argument may not have been matched. I've talked about this with <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/nicolas-grekas/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/nicolas-grekas">@nicolas-grekas</a> a long time ago: it's one of the rough spots for action DI.</p>
<p dir="auto">When I will use FOSUserBundle I have this error:<br>
<code class="notranslate">An exception has been thrown during the rendering of a template ("Warning: strtr() expects parameter 1 to be string, array given in .../vendor/symfony/symfony/src/Symfony/Component/Translation/IdentityTranslator.php line 62") in "FOSUserBundle:Registration:confirmed.html.twig".</code></p>
<p dir="auto">The same problem as <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1218390" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/1687" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/1687/hovercard" href="https://github.com/symfony/symfony/issues/1687">#1687</a>.</p>
<p dir="auto">Any idea? Thanks</p>