Skip to content

Commit

Permalink
Check if \Throwable instead of \Exception..
Browse files Browse the repository at this point in the history
..everywhere else...

fixes #5079
  • Loading branch information
nilmerg committed Aug 10, 2023
1 parent de178d0 commit 65b3006
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions library/Icinga/Application/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

namespace Icinga\Application;

use Exception;
use Icinga\Data\ConfigObject;
use Icinga\Application\Logger\Writer\FileWriter;
use Icinga\Application\Logger\Writer\SyslogWriter;
use Icinga\Exception\ConfigurationError;
use Icinga\Exception\IcingaException;
use Icinga\Util\Json;
use Throwable;

/**
* Logger
Expand Down Expand Up @@ -234,7 +234,7 @@ protected static function formatMessage(array $arguments)
if (count($arguments) === 1) {
$message = $arguments[0];

if ($message instanceof Exception) {
if ($message instanceof Throwable) {
$messages = array();
$error = $message;
do {
Expand All @@ -250,7 +250,7 @@ protected static function formatMessage(array $arguments)
array_shift($arguments),
array_map(
function ($a) {
return is_string($a) ? $a : ($a instanceof Exception
return is_string($a) ? $a : ($a instanceof Throwable
? IcingaException::describe($a)
: Json::encode($a));
},
Expand Down
2 changes: 1 addition & 1 deletion library/Icinga/Exception/IcingaException.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct($message)
$args = array_slice(func_get_args(), 1);
$exc = null;
foreach ($args as &$arg) {
if ($arg instanceof Exception) {
if ($arg instanceof Throwable) {
$exc = $arg;
}
}
Expand Down

0 comments on commit 65b3006

Please sign in to comment.