Skip to content

Commit

Permalink
Adding missed isset() check
Browse files Browse the repository at this point in the history
Making ConsoleErrorHandler handle both errors, and exceptions in CLI.
  • Loading branch information
markstory committed Nov 26, 2010
1 parent 74bf455 commit 14a6368
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cake/console/shell_dispatcher.php
Expand Up @@ -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', '/');
}
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/error_handler.php
Expand Up @@ -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);
Expand Down

0 comments on commit 14a6368

Please sign in to comment.