mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-22 21:34:28 +02:00
Check if \Throwable
instead of \Exception
..
..everywhere else... fixes #5079
This commit is contained in:
parent
de178d0086
commit
65b3006adf
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
namespace Icinga\Application;
|
namespace Icinga\Application;
|
||||||
|
|
||||||
use Exception;
|
|
||||||
use Icinga\Data\ConfigObject;
|
use Icinga\Data\ConfigObject;
|
||||||
use Icinga\Application\Logger\Writer\FileWriter;
|
use Icinga\Application\Logger\Writer\FileWriter;
|
||||||
use Icinga\Application\Logger\Writer\SyslogWriter;
|
use Icinga\Application\Logger\Writer\SyslogWriter;
|
||||||
use Icinga\Exception\ConfigurationError;
|
use Icinga\Exception\ConfigurationError;
|
||||||
use Icinga\Exception\IcingaException;
|
use Icinga\Exception\IcingaException;
|
||||||
use Icinga\Util\Json;
|
use Icinga\Util\Json;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logger
|
* Logger
|
||||||
@ -234,7 +234,7 @@ class Logger
|
|||||||
if (count($arguments) === 1) {
|
if (count($arguments) === 1) {
|
||||||
$message = $arguments[0];
|
$message = $arguments[0];
|
||||||
|
|
||||||
if ($message instanceof Exception) {
|
if ($message instanceof Throwable) {
|
||||||
$messages = array();
|
$messages = array();
|
||||||
$error = $message;
|
$error = $message;
|
||||||
do {
|
do {
|
||||||
@ -250,7 +250,7 @@ class Logger
|
|||||||
array_shift($arguments),
|
array_shift($arguments),
|
||||||
array_map(
|
array_map(
|
||||||
function ($a) {
|
function ($a) {
|
||||||
return is_string($a) ? $a : ($a instanceof Exception
|
return is_string($a) ? $a : ($a instanceof Throwable
|
||||||
? IcingaException::describe($a)
|
? IcingaException::describe($a)
|
||||||
: Json::encode($a));
|
: Json::encode($a));
|
||||||
},
|
},
|
||||||
|
@ -22,7 +22,7 @@ class IcingaException extends Exception
|
|||||||
$args = array_slice(func_get_args(), 1);
|
$args = array_slice(func_get_args(), 1);
|
||||||
$exc = null;
|
$exc = null;
|
||||||
foreach ($args as &$arg) {
|
foreach ($args as &$arg) {
|
||||||
if ($arg instanceof Exception) {
|
if ($arg instanceof Throwable) {
|
||||||
$exc = $arg;
|
$exc = $arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user