title: Exception handling in Symfony2
body: <p>How to handle exceptions manually in symfony2 in case like this:</p>
  
  <pre><code>class Foo {
  
      // ..
  
      public function __toString()
      {
          try {
              $this-&gt;render();
          }
          catch (\Exception $e)
          {
              // log $e
              // handle $e - display 500 error page in prod mode
          }
      }
  }
  </code></pre>
  
  <p>Redirect? But how.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>My solution so far is to dispatch exception event, and it works.</p>
  
  <pre><code>$dispatcher-&gt;dispatch(KernelEvents::EXCEPTION, $event)
  </code></pre>
  
  <p>But i requires creating an event. Is there some better solution?</p>