Making ConsoleErrorHandler be invoked with the correct error reporting level.

This commit is contained in:
Mark Story 2010-11-28 20:43:48 -05:00
parent 284a8db3f4
commit 91b5a5265e
2 changed files with 1 additions and 5 deletions

View file

@ -70,10 +70,6 @@ class ConsoleErrorHandler extends ErrorHandler {
* @return void
*/
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
$errorConfig = Configure::read('Error');
if (isset($errorConfig['level']) && ($code & ~$errorConfig['level'])) {
return;
}
$stderr = self::getStderr();
list($name, $log) = self::_mapErrorCode($code);
$message = sprintf(__('%s in [%s, line %s]'), $description, $file, $line);

View file

@ -145,7 +145,7 @@ class ShellDispatcher {
}
require_once CONSOLE_LIBS . 'console_error_handler.php';
set_exception_handler(array('ConsoleErrorHandler', 'handleException'));
set_error_handler(array('ConsoleErrorHandler', 'handleError'));
set_error_handler(array('ConsoleErrorHandler', 'handleError'), Configure::read('Error.level'));
if (!defined('FULL_BASE_URL')) {
define('FULL_BASE_URL', '/');