Handle exception during twig rendering