Skip to content

Commit

Permalink
Removing error masking in ErrorHandler, instead correctly calling set…
Browse files Browse the repository at this point in the history
…_error_handler() works better.
  • Loading branch information
markstory committed Nov 27, 2010
1 parent c717ff2 commit d3f0d25
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 5 additions & 4 deletions cake/libs/configure.php
Expand Up @@ -102,12 +102,13 @@ public static function bootstrap($boot = true) {
if (!include(CONFIGS . 'bootstrap.php')) {
trigger_error(sprintf(__("Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP."), CONFIGS), E_USER_ERROR);
}

if (!empty(self::$_values['Error']['handler'])) {
set_error_handler(self::$_values['Error']['handler']);
}
$level = -1;
if (isset(self::$_values['Error']['level'])) {
error_reporting(self::$_values['Error']['level']);
$level = self::$_values['Error']['level'];
}
if (!empty(self::$_values['Error']['handler'])) {
set_error_handler(self::$_values['Error']['handler'], $level);
}
if (!empty(self::$_values['Exception']['handler'])) {
set_exception_handler(self::$_values['Exception']['handler']);
Expand Down
3 changes: 0 additions & 3 deletions cake/libs/error_handler.php
Expand Up @@ -134,9 +134,6 @@ public static function handleException(Exception $exception) {
*/
public static function handleError($code, $description, $file = null, $line = null, $context = null) {
$errorConfig = Configure::read('Error');
if (isset($errorConfig['level']) && ($code & ~$errorConfig['level'])) {
return;
}
list($error, $log) = self::_mapErrorCode($code);

$debug = Configure::read('debug');
Expand Down

0 comments on commit d3f0d25

Please sign in to comment.