vendor/overblog/graphql-bundle/src/EventListener/ErrorHandlerListener.php line 28

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Overblog\GraphQLBundle\EventListener;
  4. use Overblog\GraphQLBundle\Error\ErrorHandler;
  5. use Overblog\GraphQLBundle\Event\ExecutorResultEvent;
  6. final class ErrorHandlerListener
  7. {
  8.     /** @var ErrorHandler */
  9.     private $errorHandler;
  10.     /** @var bool */
  11.     private $throwException;
  12.     /** @var bool */
  13.     private $debug;
  14.     public function __construct(ErrorHandler $errorHandler$throwException false$debug false)
  15.     {
  16.         $this->errorHandler $errorHandler;
  17.         $this->throwException $throwException;
  18.         $this->debug $debug;
  19.     }
  20.     public function onPostExecutor(ExecutorResultEvent $executorResultEvent): void
  21.     {
  22.         $result $executorResultEvent->getResult();
  23.         $this->errorHandler->handleErrors($result$this->throwException$this->debug);
  24.     }
  25. }