title: Symfony2 Controller won't catch exception
body: <p>This is the route handler for my delete action.  It works well as long as the item does not have any associations.</p>
  
  <pre><code>public function projectDeleteAction()
  {
      try {
          $request = $this-&gt;get('request');
          $my_id = $request-&gt;query-&gt;get('id');
  
          $em = $this-&gt;get('doctrine.orm.entity_manager');
  
          $item = $em-&gt;find('MyBundle:Main', $my_id);
  
          $em-&gt;remove($item);
          $em-&gt;flush();
  
          $info = $item-&gt;getName();
          $result = 0;
      }
      catch (Exception $e) {
          $info = toString($e);
          $result = -1;
      }
  
      return $this-&gt;render('MyBundle:Main:response.xml.twig',
              array('info' =&gt; $info, 'result' =&gt; $result ));
  }
  </code></pre>
  
  <p>I have already solved the error of trying to delete an item with associations, but through this process, the "flush" was throwing PDOException.  I tried various ways to catch it, but it appears to be getting caught inside Symfony2 and then it responds with a HTTP 500 error.  Is there a way that I can have Symfony2 not catch this so that I can handle it?  This is an XML response using AJAX and so I would rather just send an error code per above.</p>