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

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