1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 17:16:18 +02:00

Fix displaying anonymous classes

This commit is contained in:
Nicolas Grekas
2018-08-17 09:54:55 +02:00
parent c465e11445
commit 9117a6c747
7 changed files with 32 additions and 13 deletions

View File

@@ -12,6 +12,7 @@
namespace Monolog\Formatter;
use Exception;
use Monolog\Registry;
use Throwable;
/**
@@ -179,11 +180,11 @@ class JsonFormatter extends NormalizerFormatter
{
// TODO 2.0 only check for Throwable
if (!$e instanceof Exception && !$e instanceof Throwable) {
throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.get_class($e));
throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.Registry::getClass($e));
}
$data = array(
'class' => get_class($e),
'class' => Registry::getClass($e),
'message' => $e->getMessage(),
'code' => $e->getCode(),
'file' => $e->getFile().':'.$e->getLine(),