Skip to content
Permalink
Browse files

Adding missed isset() check

Making ConsoleErrorHandler handle both errors, and exceptions in CLI.
  • Loading branch information...
markstory committed Nov 15, 2010
1 parent 74bf455 commit 14a6368b39e24e9487876260b9c11019b662b398
Showing with 5 additions and 3 deletions.
  1. +4 −2 cake/console/shell_dispatcher.php
  2. +1 −1 cake/libs/error_handler.php
@@ -141,13 +141,15 @@ function __bootstrap() {
$boot = file_exists(ROOT . DS . APP_DIR . DS . 'config' . DS . 'bootstrap.php');
require CORE_PATH . 'cake' . DS . 'bootstrap.php';
require_once CONSOLE_LIBS . 'console_error_handler.php';
set_exception_handler(array('ConsoleErrorHandler', 'handleException'));
if (!file_exists(APP_PATH . 'config' . DS . 'core.php')) {
include_once CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'console' . DS . 'templates' . DS . 'skel' . DS . 'config' . DS . 'core.php';
App::build();
}
require_once CONSOLE_LIBS . 'console_error_handler.php';
set_exception_handler(array('ConsoleErrorHandler', 'handleException'));
set_error_handler(array('ConsoleErrorHandler', 'handleError'));
if (!defined('FULL_BASE_URL')) {
define('FULL_BASE_URL', '/');
}
@@ -93,7 +93,7 @@ public static function handleException(Exception $exception) {
*/
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
$errorConfig = Configure::read('Error');
if ($errorConfig['level'] && ($code & ~$errorConfig['level'])) {
if (isset($errorConfig['level']) && ($code & ~$errorConfig['level'])) {
return;
}
list($error, $log) = self::_mapErrorCode($code);

0 comments on commit 14a6368

Please sign in to comment.
You can’t perform that action at this time.