Get the displayer instance.

@param Request $request
@param \Exception $original
@param \Exception $transformed
@param int $code

@return DisplayerInterface
10504
protected function getDisplayer( Request $request, Exception $original, Exception $transformed, $code )
	{
		$displayers = $this->make( $this->getConfig( 'displayers', [] ) );

		if ( $filtered = $this->getFiltered( $displayers, $request, $original, $transformed, $code ) )
			return $filtered[0];

		$def = $this->getConfig( 'default' );

		return UniversalBuilder::resolveClass( $def );
	}
285167
protected function _createFormatTranslationException($message, $code = 0, \Exception $previous = null, $subject = null, TranslatorInterface $translator = null, $context = null, $params = null)
    {
        return new FormatTranslationException($message, $code, $previous, $subject, $translator, $context, $params);
    }
1174966
public function render($request, Exception $e)
    {
        if ($this->isHttpException($e))
        {
            if ($request->segment(1) == config('expendable.admin_base_uri') && !config('app.debug'))
            {
                return app('Distilleries\Expendable\Http\Controllers\Backend\Base\ErrorController')->callAction("display", [$e, $e->getStatusCode()]);
            }
        }

        return parent::render($request, $e);
    }
691445
@Override
    public final Transformer getTransformer(
            HttpServletRequest request, HttpServletResponse response) {
        final Resource stylesheetResource = this.getStylesheetResource(request);
        try {
            return this.xmlUtilities.getTransformer(stylesheetResource);
        } catch (TransformerConfigurationException e) {
            throw new RuntimeException(
                    "Failed to get Transformer for stylesheet: " + stylesheetResource, e);
        } catch (IOException e) {
            throw new RuntimeException("Failed to load stylesheet: " + stylesheetResource, e);
        }
    }
561290
public function getExceptionFor(RequestInterface $request): ClientExceptionInterface
    {
        try {
            return $this->exceptions[$request];
        } catch (\UnexpectedValueException $e) {
            throw new \UnexpectedValueException('Request not found', $e->getCode(), $e);
        }
    }
828392
public function showAction(Request $request, $exception, DebugLoggerInterface $logger = null)
    {
        $currentContent = $this->getAndCleanOutputBuffering($request->headers->get('X-Php-Ob-Level', -1));
        $code = $this->getStatusCode($exception);
        $templateData = $this->getTemplateData($currentContent, $code, $exception, $logger);

        $view = $this->createView($exception, $code, $templateData, $request, $this->showException);
        $response = $this->viewHandler->handle($view);

        return $response;
    }
229765
protected function findTemplate(Request $request, $format, $code, $debug)
    {
        if(strpos($request->getPathInfo(), '/admin') !== 0) {
            return parent::findTemplate($request, $format, $code, $debug);
        }

        $name = $debug ? 'exception' : 'error';
        if ($debug && 'html' == $format) {
            $name = 'exception_full';
        }

        // when not in debug, try to find a template for the specific HTTP status code and format
        if (!$debug) {
            $template = new TemplateReference('AvanzuAdminThemeBundle', 'Exception', $name . $code, $format, 'twig');
            if ($this->templateExists($template)) {
                return $template;
            }
        }

        // try to find a template for the given format
        $template = new TemplateReference('AvanzuAdminThemeBundle', 'Exception', $name, $format, 'twig');
        if ($this->templateExists($template)) {
            return $template;
        }

        // default to a generic HTML exception
        $request->setRequestFormat('html');

        $template = new TemplateReference('AvanzuAdminThemeBundle', 'Exception', $name, 'html', 'twig');
        if ($this->templateExists($template)) {
            return $template;
        }

        return parent::findTemplate($request, $format, $code, $debug);
    }
197210
public function render($request, Exception $e)
	{
		if ($this->isHttpException($e))
		{
			return $this->renderHttpException($e);
		}
		else
		{
			return (new SymfonyDisplayer(config('app.debug')))->createResponse($e);
		}
	}
732018
public function addToDataClass(Request $request, AbstractTransfer $quoteTransfer): QuoteTransfer
    {
        return $this->getFactory()->createPayoneHandler()->addPaymentToQuote($request, $quoteTransfer);
    }
124936
public function render($request, Exception $e)
    {
        //        if ($request->isXmlHttpRequest())
//            return $this->renderXmlHttpException($e);

        if (config('app.debug')) {
            if ($request->isXmlHttpRequest()) {
                return $this->renderDebugXmlHttpException($e);
            }

            return $this->renderExceptionWithWhoops($e);
        }

        return parent::render($request, $e);
    }
503703
public function filter( array $displayers, Request $request, Exception $original, Exception $transformed, $code )
	{
		if ( $this->debug !== true )
			foreach ( $displayers as $index => $displayer )
				if ( $displayer->isVerbose() )
					unset( $displayers[$index] );

		return array_values( $displayers );
	}
865434
protected function findTemplate(Request $request, $format, $code, $showException)
    {
        $name = $showException ? 'exception' : 'error';
        if ($showException && 'html' == $format) {
            $name = 'exception_full';
        }

        // For error pages, try to find a template for the specific HTTP status code and format
        if (!$showException) {
            $template = sprintf('@Twig/Exception/%s%s.%s.twig', $name, $code, $format);
            if ($this->templateExists($template)) {
                return $template;
            }
        }

        // try to find a template for the given format
        $template = sprintf('@Twig/Exception/%s.%s.twig', $name, $format);
        if ($this->templateExists($template)) {
            return $template;
        }

        // default to a generic HTML exception
        $request->setRequestFormat('html');

        return sprintf('@Twig/Exception/%s.html.twig', $showException ? 'exception_full' : $name);
    }
107307
protected function getOriginalRequest(RequestInterface $request)
    {
        $original = $request;
        // The number of redirects is held on the original request, so determine which request that is
        while ($parent = $original->getParams()->get(self::PARENT_REQUEST)) {
            $original = $parent;
        }

        return $original;
    }
148218
public function render($request, Exception $exception)
	{
		return $this->resolve($exception)->render($request, $exception) ?? parent::render($request, $exception);
	}
1300432
public function render($request, Exception $e)
    {
        if ($e instanceof HttpResponseException) {
            return $e->getResponse();
        } elseif ($e instanceof ModelNotFoundException) {
            $e = new NotFoundHttpException($e->getMessage(), $e);
        } elseif ($e instanceof AuthorizationException) {
            $e = new HttpException(403, $e->getMessage());
        } elseif ($e instanceof ValidationException && $e->getResponse()) {
            return $e->getResponse();
        }

        $fe = FlattenException::create($e);

        $handler = new SymfonyExceptionHandler(\env('APP_DEBUG', false));

        $decorated = $this->decorate($handler->getContent($fe), $handler->getStylesheet($fe));

        $response = new Response($decorated, $fe->getStatusCode(), $fe->getHeaders());

        $response->exception = $e;

        return $response;
    }
657187
public function render(Request $request, Exception $e)
    {
        $e = $this->prepareException($e);

        if ($e instanceof HttpResponseException) {
            return $e->getResponse();
        } else if ($e instanceof AuthenticationException) {
            return $this->unauthenticated($request, $e);
        } else if ($e instanceof ValidationException) {
            return $this->convertValidationExceptionToResponse($e, $request);
        }

        return $this->prepareResponse($request, $e);
    }
231414
public static function transform($object, $request)
	{
		$transformer = static::getTransformer($object);
		if (!$transformer) {
			return $object;
		}
		
		return $transformer->transform($object, $request);
	}