<p dir="auto">Symfony 2.0.4. When specifying "index" as a name for the route - exception "No route found for GET /" raised.<br>
`<br>
/**</p>
<ul dir="auto">
<li><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/route/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/route">@route</a>("/", name="index")<br>
*/<br>
public function indexAction()<br>
{<br>
}<br>
`</li>
</ul>
<p dir="auto">But renaming route to anything else solves the issue.</p>
<p dir="auto"><strong>Symfony version(s) affected</strong>: 4.2.*</p>
<p dir="auto"><strong>Description</strong></p>
<p dir="auto">According to Symfony <a href="https://symfony.com/doc/current/reference/constraints/UniqueEntity.html#message" rel="nofollow">UniqueEntity documentation </a> if the constraint is violated then I can create a custom message error by implementing the <code class="notranslate">__toString()</code> method on my Entity.</p>
<p dir="auto">I've attempted to create my custom message via the <code class="notranslate">validation.yaml</code> (which <strong>works</strong>) and I've implemented the <code class="notranslate">__toString()</code> method (which does <strong>not</strong> work)</p>
<p dir="auto">According to the docs:</p>
<blockquote>
<p dir="auto">Messages can include the {{ value }} placeholder to display a string representation of the invalid entity. If the entity doesn't define the __toString() method, the following generic value will be used: "Object of class <strong>CLASS</strong> identified by "</p>
</blockquote>
<p dir="auto"><strong>How to reproduce</strong></p>
<p dir="auto">To reproduce, clone my project and follow README.md guide:<br>
<a href="https://github.com/kemicofa/unique_entity_custom_message_tostring_bug">https://github.com/kemicofa/unique_entity_custom_message_tostring_bug</a></p>
<p dir="auto">Once, the project is installed run the WebCaseTest that I've implemented.</p>
<p dir="auto">Essentially my project will attempt to insert two users with the same email in the database.<br>
The first works as expected and the second fails as expected. However, the second response doesn't have the expected <code class="notranslate">__toString()</code> return message sent, only the default message is sent:</p>
<blockquote>
<p dir="auto">Object(App\Entity\User).email: /** more text here */</p>
</blockquote>
<p dir="auto"><strong>Possible Solution</strong></p>

<p dir="auto"><strong>Additional context</strong></p>