mirror of
https://github.com/filp/whoops.git
synced 2026-09-14 11:46:19 +00:00
Merge branch 'hotfix/move-is-level-fatal' of https://github.com/Vmak11/whoops into bugfix/fix-issue-with-stacktrace
Conflicts: src/Whoops/Exception/Inspector.php src/Whoops/Run.php
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
namespace Whoops\Exception;
|
||||
|
||||
use Exception;
|
||||
use Whoops\Run;
|
||||
use Whoops\Util\Misc;
|
||||
|
||||
class Inspector
|
||||
{
|
||||
@@ -160,7 +160,7 @@ class Inspector
|
||||
return $traces;
|
||||
}
|
||||
|
||||
if (!Run::isLevelFatal($e->getCode())) {
|
||||
if (!Misc::isLevelFatal($e->getSeverity())) {
|
||||
return $traces;
|
||||
}
|
||||
|
||||
|
||||
+2
-12
@@ -13,6 +13,7 @@ use Whoops\Exception\Inspector;
|
||||
use Whoops\Handler\CallbackHandler;
|
||||
use Whoops\Handler\Handler;
|
||||
use Whoops\Handler\HandlerInterface;
|
||||
use Whoops\Util\Misc;
|
||||
|
||||
class Run
|
||||
{
|
||||
@@ -346,7 +347,7 @@ class Run
|
||||
$this->canThrowExceptions = false;
|
||||
|
||||
$error = error_get_last();
|
||||
if ($error && $this->isLevelFatal($error['type'])) {
|
||||
if ($error && Misc::isLevelFatal($error['type'])) {
|
||||
// If there was a fatal error,
|
||||
// it was not handled in handleError yet.
|
||||
$this->handleError(
|
||||
@@ -394,15 +395,4 @@ class Run
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function isLevelFatal($level)
|
||||
{
|
||||
$errors = E_ERROR;
|
||||
$errors |= E_PARSE;
|
||||
$errors |= E_CORE_ERROR;
|
||||
$errors |= E_CORE_WARNING;
|
||||
$errors |= E_COMPILE_ERROR;
|
||||
$errors |= E_COMPILE_WARNING;
|
||||
return ($level & $errors) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,4 +41,21 @@ class Misc
|
||||
}
|
||||
return "E_UNKNOWN";
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if an error level is fatal (halts execution)
|
||||
*
|
||||
* @param int $level
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isLevelFatal($level)
|
||||
{
|
||||
$errors = E_ERROR;
|
||||
$errors |= E_PARSE;
|
||||
$errors |= E_CORE_ERROR;
|
||||
$errors |= E_CORE_WARNING;
|
||||
$errors |= E_COMPILE_ERROR;
|
||||
$errors |= E_COMPILE_WARNING;
|
||||
return ($level & $errors) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user