Skip to content
Snippets Groups Projects

Issue #3330474: JSON:API should include validation constraint violations in log context

Open Issue #3330474: JSON:API should include validation constraint violations in log context
1 unresolved thread
Open Brad Jones requested to merge issue/drupal-3330474:3330474-jsonapi-should-include into 11.x
1 unresolved thread
Files
5
@@ -4,7 +4,6 @@
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Utility\Error;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\KernelEvents;
@@ -12,14 +11,7 @@
/**
* Log exceptions without further handling.
*/
class ExceptionLoggingSubscriber implements EventSubscriberInterface {
/**
* The logger channel factory.
*
* @var \Drupal\Core\Logger\LoggerChannelFactoryInterface
*/
protected $logger;
class ExceptionLoggingSubscriber implements ExceptionLoggingSubscriberInterface {
/**
* Constructs a new ExceptionLoggingSubscriber.
@@ -27,9 +19,7 @@ class ExceptionLoggingSubscriber implements EventSubscriberInterface {
* @param \Drupal\Core\Logger\LoggerChannelFactoryInterface $logger
* The logger channel factory.
*/
public function __construct(LoggerChannelFactoryInterface $logger) {
$this->logger = $logger;
}
public function __construct(protected LoggerChannelFactoryInterface $logger) {}
/**
* Log 403 errors.
@@ -98,7 +88,7 @@ public function onClientError(ExceptionEvent $event) {
* @param \Symfony\Component\HttpKernel\Event\ExceptionEvent $event
* The event to process.
*/
public function onException(ExceptionEvent $event) {
public function onException(ExceptionEvent $event): void {
$exception = $event->getThrowable();
$method = 'onError';
Loading