disable error pages in Symfony

php, symfony

Solution

To disable twig error pages you can just add something like

services:
   twig.exception_listener:
     class: DateTime #or another dummy class

to your app/config.yml

After this you will see much simple screen produced by Symfony\Component\HttpKernel\Debug\ExceptionHandler. If you want to remove this behavior - replace this class or just comment set_exception_handler call in.

public static function register($debug = true)
{
    $handler = new static($debug);

    set_exception_handler(array($handler, 'handle'));

    return $handler;
}

Problem

I would like to TOTALLY disable the twig error pages in Symfony. I do not want to customize them as described here: http://symfony.com/doc/2.0/cookbook/controller/error_pages.html but rather simply unplug the exception handling mechanism of twig and end up with plain good old php errors. Is it possible at all?

Original source