Browse Source

fix Exception\Throwable order

tags/2.0.43
Игорь Тарасов 3 years ago
parent
commit
330166e703
  1. 4
      framework/db/BaseActiveRecord.php
  2. 2
      framework/log/DbTarget.php
  3. 2
      framework/log/SyslogTarget.php
  4. 2
      framework/log/Target.php

4
framework/db/BaseActiveRecord.php

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

2
framework/log/DbTarget.php

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

2
framework/log/SyslogTarget.php

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

2
framework/log/Target.php

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

Loading…
Cancel
Save