Reference
C
Class

ApiPlatform\Symfony\EventListener\ErrorListener

This error listener extends the Symfony one in order to add the _api_operation attribute when the request is duplicated. It will later be used to retrieve the exceptionToStatus from the operation (ExceptionAction).

class ApiPlatform\Symfony\EventListener\ErrorListener extends Symfony\Component\HttpKernel\EventListener\ErrorListener implements Symfony\Component\EventDispatcher\EventSubscriberInterface
{
    protected duplicateRequest(Throwable $exception, Symfony\Component\HttpFoundation\Request $request): Symfony\Component\HttpFoundation\Request
    public __construct(null|object|array|string $controller, null|Psr\Log\LoggerInterface $logger, bool $debug, array<string, array> $exceptionsMapping)
    public logKernelException(Symfony\Component\HttpKernel\Event\ExceptionEvent $event)
    public onKernelException(Symfony\Component\HttpKernel\Event\ExceptionEvent $event)
    public removeCspHeader(Symfony\Component\HttpKernel\Event\ResponseEvent $event): null
    public onControllerArguments(Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent $event)
    public getSubscribedEvents(): array
    protected logException(Throwable $exception, string $message, null|string $logLevel): null
}
class ApiPlatform\Symfony\EventListener\ErrorListener extends Symfony\Component\HttpKernel\EventListener\ErrorListener implements Symfony\Component\EventDispatcher\EventSubscriberInterface
{
    protected duplicateRequest(Throwable $exception, Symfony\Component\HttpFoundation\Request $request): Symfony\Component\HttpFoundation\Request
    public __construct(null|object|array|string $controller, null|Psr\Log\LoggerInterface $logger, bool $debug, array<string, array> $exceptionsMapping)
    public logKernelException(Symfony\Component\HttpKernel\Event\ExceptionEvent $event)
    public onKernelException(Symfony\Component\HttpKernel\Event\ExceptionEvent $event)
    public removeCspHeader(Symfony\Component\HttpKernel\Event\ResponseEvent $event): null
    public onControllerArguments(Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent $event)
    public getSubscribedEvents(): array
    protected logException(Throwable $exception, string $message, null|string $logLevel): null
}

Properties

controller

$controller
$controller

logger

$logger
$logger

debug

$debug
$debug

exceptionsMapping

array<string, array> $exceptionsMapping
array<string, array> $exceptionsMapping

Methods

duplicateRequest

protected duplicateRequest(Throwable $exception, Symfony\Component\HttpFoundation\Request $request): Symfony\Component\HttpFoundation\Request
protected duplicateRequest(Throwable $exception, Symfony\Component\HttpFoundation\Request $request): Symfony\Component\HttpFoundation\Request

Parameters

exceptionThrowable
requestSymfony\Component\HttpFoundation\Request

Returns

Symfony\Component\HttpFoundation\Request

Copyright © 2023 Kévin Dunglas

Sponsored by Les-Tilleuls.coop