From c193ce708a7920535b4e8aaab7499518e6f9fcde Mon Sep 17 00:00:00 2001 From: ADmad Date: Sun, 3 Aug 2014 03:11:19 +0530 Subject: [PATCH] Throw exception instead of logging in debug mode. --- lib/Cake/View/Helper/CacheHelper.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Cake/View/Helper/CacheHelper.php b/lib/Cake/View/Helper/CacheHelper.php index 46d1943db..f72c9b1e6 100644 --- a/lib/Cake/View/Helper/CacheHelper.php +++ b/lib/Cake/View/Helper/CacheHelper.php @@ -109,6 +109,7 @@ class CacheHelper extends AppHelper { * @param string $out output to cache * @return string view output * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/cache.html + * @throws Exception If debug mode is enabled and writing to cache file fails. */ public function cache($file, $out) { $cacheTime = 0; @@ -153,6 +154,10 @@ class CacheHelper extends AppHelper { try { $this->_writeFile($cached, $cacheTime, $useCallbacks); } catch (Exception $e) { + if (Configure::read('debug')) { + throw $e; + } + $message = __d( 'cake_dev', 'Unable to write view cache file: "%s" for "%s"',