Fix uncaught exceptions when generating view cache files

Fixes #3016
This commit is contained in:
mark_story 2012-07-30 21:27:21 -04:00
parent dc7c31e7ec
commit 9b94133f0d

View file

@ -150,7 +150,17 @@ class CacheHelper extends AppHelper {
if ($cacheTime != '' && $cacheTime > 0) { if ($cacheTime != '' && $cacheTime > 0) {
$cached = $this->_parseOutput($out); $cached = $this->_parseOutput($out);
try {
$this->_writeFile($cached, $cacheTime, $useCallbacks); $this->_writeFile($cached, $cacheTime, $useCallbacks);
} catch (Exception $e) {
$message = __d(
'cake_dev',
'Unable to write view cache file: "%s" for "%s"',
$e->getMessage(),
$this->request->here
);
$this->log($message, 'error');
}
$out = $this->_stripTags($out); $out = $this->_stripTags($out);
} }
return $out; return $out;