diff --git a/framework/db/BaseActiveRecord.php b/framework/db/BaseActiveRecord.php index d338b0e..601055c 100644 --- a/framework/db/BaseActiveRecord.php +++ b/framework/db/BaseActiveRecord.php @@ -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; } } diff --git a/framework/log/DbTarget.php b/framework/log/DbTarget.php index 343ade6..bef9c50 100644 --- a/framework/log/DbTarget.php +++ b/framework/log/DbTarget.php @@ -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); diff --git a/framework/log/SyslogTarget.php b/framework/log/SyslogTarget.php index 4d766fa..6a9b0cf 100644 --- a/framework/log/SyslogTarget.php +++ b/framework/log/SyslogTarget.php @@ -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); diff --git a/framework/log/Target.php b/framework/log/Target.php index 819669e..d57c261 100644 --- a/framework/log/Target.php +++ b/framework/log/Target.php @@ -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);