mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-08 06:06:40 +02:00
Fix a wrong check on Error Handler and removed an old bug
This commit is contained in:
@@ -58,9 +58,6 @@ class ErrorHandler
|
|||||||
*/
|
*/
|
||||||
public static function register(LoggerInterface $logger, $errorLevelMap = [], $exceptionLevelMap = [], $fatalLevel = null): self
|
public static function register(LoggerInterface $logger, $errorLevelMap = [], $exceptionLevelMap = [], $fatalLevel = null): self
|
||||||
{
|
{
|
||||||
//Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929
|
|
||||||
class_exists('\\Psr\\Log\\LogLevel', true);
|
|
||||||
|
|
||||||
$handler = new static($logger);
|
$handler = new static($logger);
|
||||||
if ($errorLevelMap !== false) {
|
if ($errorLevelMap !== false) {
|
||||||
$handler->registerErrorHandler($errorLevelMap);
|
$handler->registerErrorHandler($errorLevelMap);
|
||||||
@@ -150,6 +147,7 @@ class ErrorHandler
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
|
* @param \Exception $e
|
||||||
*/
|
*/
|
||||||
public function handleException($e)
|
public function handleException($e)
|
||||||
{
|
{
|
||||||
@@ -171,7 +169,7 @@ class ErrorHandler
|
|||||||
call_user_func($this->previousExceptionHandler, $e);
|
call_user_func($this->previousExceptionHandler, $e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!headers_sent() && ini_get('display_errors') === 0) {
|
if (!headers_sent() && !ini_get('display_errors')) {
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user