From 706b94e9ad1c7f0f748eb14324d2aeacee8e1234 Mon Sep 17 00:00:00 2001 From: Jeremy Bush Date: Tue, 13 Jul 2010 13:19:47 -0500 Subject: [PATCH] modifying exceptions to use kohanas error handler --- classes/kostache.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/classes/kostache.php b/classes/kostache.php index 39f322c..ae05431 100644 --- a/classes/kostache.php +++ b/classes/kostache.php @@ -119,4 +119,22 @@ class Kostache extends Mustache return $this; } + + /** + * Overriding __toString to use Kohana's exception handler + * + * @return string + */ + public function __toString() + { + try + { + $result = $this->render(); + return $result; + } + catch (Exception $e) { + Kohana::exception_handler($e); + return ''; + } + } }