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:
@@ -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(),
|
||||
|
Reference in New Issue
Block a user