title: Catching doctrine exception Symfony2
body: <p>How can i catching a doctrine exception ? 
  I am trying the code found here : 
  <a href="https://stackoverflow.com/questions/20325746/how-to-catch-exception-in-symfony-2">How to catch Exception in symfony 2?</a>
  <a href="https://stackoverflow.com/questions/12229120/why-symfony2-dont-catch-exceptions">Why Symfony2 dont catch exceptions</a>
  But that doesn't work.</p>
  
  <p>Code : </p>
  
  <pre><code>try{
  
      $emOperateur-&gt;flush();                      
      return $this-&gt;redirect($request-&gt;getUri());
  
  }catch(\Doctrine\ORM\ORMException $e){
  
      $this-&gt;get('session')-&gt;getFlashBag()-&gt;add('error', 'Blablablabla');
  }
  </code></pre>
  
  <p>When i insert a tuple with same primary key, that doesn't go in catch and i have a screen with classic error message.</p>