mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Throw exception instead of logging in debug mode.
This commit is contained in:
parent
8e40fcf5ef
commit
c193ce708a
1 changed files with 5 additions and 0 deletions
|
@ -109,6 +109,7 @@ class CacheHelper extends AppHelper {
|
||||||
* @param string $out output to cache
|
* @param string $out output to cache
|
||||||
* @return string view output
|
* @return string view output
|
||||||
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/cache.html
|
* @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) {
|
public function cache($file, $out) {
|
||||||
$cacheTime = 0;
|
$cacheTime = 0;
|
||||||
|
@ -153,6 +154,10 @@ class CacheHelper extends AppHelper {
|
||||||
try {
|
try {
|
||||||
$this->_writeFile($cached, $cacheTime, $useCallbacks);
|
$this->_writeFile($cached, $cacheTime, $useCallbacks);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
if (Configure::read('debug')) {
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
|
||||||
$message = __d(
|
$message = __d(
|
||||||
'cake_dev',
|
'cake_dev',
|
||||||
'Unable to write view cache file: "%s" for "%s"',
|
'Unable to write view cache file: "%s" for "%s"',
|
||||||
|
|
Loading…
Reference in a new issue