mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
fix Exception\Throwable order
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user