src/Viserio/Component/Exception/Provider/HttpExceptionServiceProvider.php
public static function createExceptionHandler(ContainerInterface $container): HttpHandlerContract
    {
        $logger = null;

        if ($container->has(LoggerInterface::class)) {
            $logger = $container->get(LoggerInterface::class);
        }

        $config = $container->get('config');

        $handler = new Handler(
            $config,
            $container->get(ResponseFactoryInterface::class),
            $logger
        );

        $handler->addFilter($container->get(VerboseFilter::class), 32);
        $handler->addFilter($container->get(CanDisplayFilter::class), 64);
        $handler->addFilter($container->get(ContentTypeFilter::class), 128);

        $handler->addDisplayer($container->get(SymfonyDisplayer::class), 64);

        if ($container->has(FactoryContract::class)) {
            $handler->addDisplayer($container->get(ViewDisplayer::class), 128);
        }

        $handler->addDisplayer($container->get(HtmlDisplayer::class), 256);

        if (\class_exists(Run::class)) {
            $handler->addDisplayer($container->get(WhoopsPrettyDisplayer::class), 32);
            $handler->addDisplayer($container->get(WhoopsJsonDisplayer::class), 512);
        }

        $handler->addDisplayer($container->get(JsonDisplayer::class), 1024);
        $handler->addDisplayer($container->get(JsonApiDisplayer::class), 2048);

        return $handler;
    }
public static function createExceptionHandler(ContainerInterface $container): HttpHandlerContract
    {
        $logger = null;

        if ($container->has(LoggerInterface::class)) {
            $logger = $container->get(LoggerInterface::class);
        }

        $config = $container->get('config');

        $handler = new Handler(
            $config,
            $container->get(ResponseFactoryInterface::class),
            $logger
        );

        $handler->addFilter($container->get(VerboseFilter::class), 32);
        $handler->addFilter($container->get(CanDisplayFilter::class), 64);
        $handler->addFilter($container->get(ContentTypeFilter::class), 128);

        $handler->addDisplayer($container->get(SymfonyDisplayer::class), 64);

        if ($container->has(FactoryContract::class)) {
            $handler->addDisplayer($container->get(ViewDisplayer::class), 128);
        }

        $handler->addDisplayer($container->get(HtmlDisplayer::class), 256);

        if (\class_exists(Run::class)) {
            $handler->addDisplayer($container->get(WhoopsPrettyDisplayer::class), 32);
            $handler->addDisplayer($container->get(WhoopsJsonDisplayer::class), 512);
        }

        $handler->addDisplayer($container->get(JsonDisplayer::class), 1024);
        $handler->addDisplayer($container->get(JsonApiDisplayer::class), 2048);

        return $handler;
    }
Create a new Handler instance.

@param \Psr\Container\ContainerInterface $container

@return \Viserio\Component\Contract\Exception\HttpHandler