IcingaException: Expect `\Throwable` instead `\Exception`

This commit is contained in:
Johannes Meyer 2023-08-09 15:36:07 +02:00
parent c6d4bf5020
commit 0a6db983f3
1 changed files with 5 additions and 4 deletions

View File

@ -5,6 +5,7 @@ namespace Icinga\Exception;
use Exception; use Exception;
use ReflectionClass; use ReflectionClass;
use Throwable;
class IcingaException extends Exception class IcingaException extends Exception
{ {
@ -51,11 +52,11 @@ class IcingaException extends Exception
* *
* The format used is: %class% in %path%:%line% with message: %message% * The format used is: %class% in %path%:%line% with message: %message%
* *
* @param Exception $exception * @param Throwable $exception
* *
* @return string * @return string
*/ */
public static function describe(Exception $exception) public static function describe(Throwable $exception)
{ {
return sprintf( return sprintf(
'%s in %s:%d with message: %s', '%s in %s:%d with message: %s',
@ -70,11 +71,11 @@ class IcingaException extends Exception
* Return the same as {@link Exception::getTraceAsString()} for the given exception, * Return the same as {@link Exception::getTraceAsString()} for the given exception,
* but show only the types of scalar arguments * but show only the types of scalar arguments
* *
* @param Exception $exception * @param Throwable $exception
* *
* @return string * @return string
*/ */
public static function getConfidentialTraceAsString(Exception $exception) public static function getConfidentialTraceAsString(Throwable $exception)
{ {
$trace = array(); $trace = array();