diff --git a/lib/Cake/Error/ErrorHandler.php b/lib/Cake/Error/ErrorHandler.php index 18efed6ce..e7fe53da5 100644 --- a/lib/Cake/Error/ErrorHandler.php +++ b/lib/Cake/Error/ErrorHandler.php @@ -236,6 +236,8 @@ class ErrorHandler { * @param string $file File on which error occurred * @param int $line Line that triggered the error * @return bool + * @throws FatalErrorException If the Exception renderer threw an exception during rendering, and debug > 0. + * @throws InternalErrorException If the Exception renderer threw an exception during rendering, and debug is 0. */ public static function handleFatalError($code, $description, $file, $line) { $logMessage = 'Fatal Error (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']'; diff --git a/lib/Cake/Test/Case/Error/ErrorHandlerTest.php b/lib/Cake/Test/Case/Error/ErrorHandlerTest.php index b2f87882d..2db99959f 100644 --- a/lib/Cake/Test/Case/Error/ErrorHandlerTest.php +++ b/lib/Cake/Test/Case/Error/ErrorHandlerTest.php @@ -25,9 +25,16 @@ App::uses('Router', 'Routing'); */ class FaultyExceptionRenderer extends ExceptionRenderer { +/** + * Dummy rendering implementation. + * + * @return void + * @throws Exception + */ public function render() { throw new Exception('Error from renderer.'); } + } /** @@ -339,7 +346,7 @@ class ErrorHandlerTest extends CakeTestCase { public function testExceptionRendererNestingDebug() { Configure::write('debug', 2); Configure::write('Exception.renderer', 'FaultyExceptionRenderer'); - ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__ ,__LINE__); + ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__, __LINE__); } /** @@ -351,7 +358,7 @@ class ErrorHandlerTest extends CakeTestCase { public function testExceptionRendererNestingProduction() { Configure::write('debug', 0); Configure::write('Exception.renderer', 'FaultyExceptionRenderer'); - ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__ ,__LINE__); + ErrorHandler::handleFatalError(E_USER_ERROR, 'Initial error', __FILE__, __LINE__); } }