fix Exception\Throwable order

This commit is contained in:
Игорь Тарасов
2021-06-13 18:07:43 +05:00
parent bbb756a876
commit 330166e703
4 changed files with 5 additions and 5 deletions

View File

@ -335,9 +335,9 @@ abstract class BaseActiveRecord extends Model implements ActiveRecordInterface
{
try {
return $this->__get($name) !== null;
} catch (\Throwable $t) {
} catch (\Exception $t) {
return false;
} catch (\Exception $e) {
} catch (\Throwable $e) {
return false;
}
}

View File

@ -78,7 +78,7 @@ class DbTarget extends Target
list($text, $level, $category, $timestamp) = $message;
if (!is_string($text)) {
// exceptions may not be serializable if in the call stack somewhere is a Closure
if ($text instanceof \Throwable || $text instanceof \Exception) {
if ($text instanceof \Exception || $text instanceof \Throwable) {
$text = (string) $text;
} else {
$text = VarDumper::export($text);

View File

@ -84,7 +84,7 @@ class SyslogTarget extends Target
$level = Logger::getLevelName($level);
if (!is_string($text)) {
// exceptions may not be serializable if in the call stack somewhere is a Closure
if ($text instanceof \Throwable || $text instanceof \Exception) {
if ($text instanceof \Exception || $text instanceof \Throwable) {
$text = (string) $text;
} else {
$text = VarDumper::export($text);

View File

@ -296,7 +296,7 @@ abstract class Target extends Component
$level = Logger::getLevelName($level);
if (!is_string($text)) {
// exceptions may not be serializable if in the call stack somewhere is a Closure
if ($text instanceof \Throwable || $text instanceof \Exception) {
if ($text instanceof \Exception || $text instanceof \Throwable) {
$text = (string) $text;
} else {
$text = VarDumper::export($text);