From: fabien Date: Tue, 10 Nov 2009 21:39:18 +0000 (+0000) Subject: fixed output when an error occurs in a template and render() is used (closes #23) X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=74dbd388dc82ad060e2f4396ee95128146917bbd;p=konrad%2Ftwig.git fixed output when an error occurs in a template and render() is used (closes #23) git-svn-id: http://svn.twig-project.org/trunk@126 93ef8e89-cb99-4229-a87c-7fa0fa45744b --- diff --git a/lib/Twig/Template.php b/lib/Twig/Template.php index c7fd399..d37e7be 100644 --- a/lib/Twig/Template.php +++ b/lib/Twig/Template.php @@ -21,7 +21,16 @@ abstract class Twig_Template extends Twig_Resource implements Twig_TemplateInter public function render(array $context) { ob_start(); - $this->display($context); + try + { + $this->display($context); + } + catch (Exception $e) + { + ob_end_clean(); + + throw $e; + } return ob_get_clean(); }