title: symfony2 exceptions - don't return HTML
body: <p>I've got a symfony2 bundle where I use <a href="https://github.com/jcubic/jquery.terminal" rel="nofollow">jquery terminal</a> project. It's a simple javascript console where the user passes some instructions which are executed on server side with AJAX/JSON and returned to the console and displayed. The php server scripts reads the browser-terminal request from <code>$GLOBALS['HTTP_RAW_POST_DATA']</code>.</p>
  
  <p>Currently, when any request throws an error, symfony2 returns a whole HTML response. I don't want the HTML part (I'd like to display the exception message/code only).</p>
  
  <p>The problem is: <strong>symfony2 handles exceptions and catches them somewhere, embedding in HTML and returns such response. I want to modify this - the exc. may be caught, but I want no HTML included</strong>. There is one distinct bundle, made only for the console stuff.</p>