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
This commit is contained in:
fabien
2009-11-10 21:39:18 +00:00
parent 5d28604a05
commit 74dbd388dc
+10 -1
View File
@@ -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();
}