Sets the variables in the exception renderer

@param Request $request The current HTTP request
515852
private function setExceptionRendererVars(Request $request)
    {
        $this->exceptionRenderer->setRequest($request);

        if ($this->container->hasBinding(ICompiler::class)) {
            $this->exceptionRenderer->setViewCompiler($this->container->resolve(ICompiler::class));
        }

        if ($this->container->hasBinding(IViewFactory::class)) {
            $this->exceptionRenderer->setViewFactory($this->container->resolve(IViewFactory::class));
        }
    }
495402
public function renderAction(Request $request)
    {

        //TODO: render initial block via ajax
        $blockType = $request->get('blockType', null);
        $action    = $request->get('action', null);

        // merge all parameters
        $params = array_merge($request->request->all(), $request->query->all());

        // load block service
        $block = $this->getBlockServiceManager()->getService($blockType);
        if (!$block) {
            throw $this->createNotFoundException(sprintf('Cannot find block service "%s"', $blockType));
        }

        if(!$block instanceof AbstractAdminBlockService) {
            throw new \Exception('Block should be an instance of AbstractAdminBlockService');
        }

        $params['block'] = $block;

        $methodName = sprintf("%sAction", $action);

        if (!is_callable(array($block, $methodName), false)) {
            throw $this->createNotFoundException(sprintf('Cannot find method "%s" in block service "%s"', $methodName, $blockType));
        }

        return call_user_func_array(array($block, $methodName), array($request, $params));
    }
1075582
public function checkRequestForArraySessions(Request $request)
	{
		if (is_null($this->reject)) return;

		if (call_user_func($this->reject, $request))
		{
			$this->manager->setDefaultDriver('array');
		}
	}
451675
@Override
	protected void preparePaintComponent(final Request request) {
		if (!isInitialised()) {
			repeat.setData(getNames());
			setInitialised(true);
		}
	}
177089
public function render($request, Exception $exception)
  {
    $exception = $this->prepare($exception);

    if ($exception instanceof ClientErrorsException) {
      return $exception->handle();
    }

    if ($exception instanceof ServerErrorsException) {
      return $exception->handle();
    }

    Events::trigger('internal.error', [$exception]);
  }
1322304
public function bindRequest(Request $request)
    {
        $this->request = $request;

        foreach ($this->request->postArray() as $key => $value) {
            if (isset($this->fieldSet[$key])) {
                $this->fieldSet[$key]->setValue($value);
            }
        }
    }
649844
public function render($request, Exception $e)
	{
		if ($this->isHttpException($e))
		{
			return $this->renderHttpException($e);
		}
		else
		{
			return parent::render($request, $e);
		}
	}
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);
    }
113887
protected function handleException($request, Exception $e)
    {
        $this->reportException($e);

        return $this->renderException($request, $e);
    }
786528
public function handleRequest(Request $request) : void
    {
        $this->reset();
        $this->readSessionId($request);

        if ($this->isTimeToCollectGarbage()) {
            $this->collectGarbage();
        }

        $this->inRequest = true;
    }
1076542
protected function resolveRenderer(Request $request)
    {
        if ($request->hasArgument('renderer') && isset($this->renderer[$request->getArgument('renderer')])) {
            $rendererClassName = $this->renderer[$request->getArgument('renderer')];
            /** @var RenderingInterface $renderer */
            $renderer = new $rendererClassName();
            if ($renderer->canRender($request)) {
                return $renderer;
            }
        }

        foreach ($this->renderer as $rendererClassName) {
            /** @var RenderingInterface $renderer */
            $renderer = new $rendererClassName();
            if ($renderer->canRender($request)) {
                return $renderer;
            }
        }

        throw new Exception('No renderer found for this request!', 1403628294);
    }
672746
public function render($request, Exception $e)
    {
        $transformed = $this->getTransformed($e);

        $response = $e instanceof Responsable ? $e->toResponse($request) : null;

        if (!$response && ($e instanceof OldHttpResponseException || $e instanceof NewHttpResponseException)) {
            $response = $e->getResponse();
        }

        if (!$response instanceof SymfonyResponse) {
            try {
                $response = $this->getResponse($request, $e, $transformed);
            } catch (Throwable $e) {
                $this->report($e instanceof Exception ? $e : new FatalThrowableError($e));

                $response = new Response('Internal server error.', 500, ['Content-Type' => 'text/plain']);
            }
        }

        return $this->toIlluminateResponse($response, $transformed);
    }
882169
public function run(HTTPRequest $request) {
		$options = $request->getRoute()->getOptions();
		if( empty($options['render']) ) {
			throw new Exception('The StaticPageController requires a render option, add it to your routes configuration.');
		}
		return HTMLHTTPResponse::render($options['render']);
	}
649049
public function render($request, Exception $e)
    {
        if ($this->isHttpException($e)) {
            $code = $e->getStatusCode();

            if ($code !== 500 || App::environment('production') || App::environment('staging')) {
                $page = Page::findByInternalName($code);

                if ($page) {
                    $request = Request::create($page->url()->getLocation(), 'GET');

                    return response(Route::dispatch($request)->getContent(), $code);
                }
            }
        }

        return parent::render($request, $e);
    }
339796
public function setRequest(Request $request)
    {
        $this->request = $request;

        $this->input = $request->request->all() + $request->query->all();
    }
709230
public function handle($request)
    {
        try {
            $this->app['events']->fire('kernel.handling', [$request]);

            $request->enableHttpMethodParameterOverride();

            $response = $this->sendRequestThroughRouter($request);
        } catch (Exception $e) {
            $this->reportException($e);

            $response = $this->renderException($request, $e);
        } catch (Throwable $e) {
            $this->reportException($e = new FatalThrowableError($e));

            $response = $this->renderException($request, $e);
        }

        $this->app['events']->fire('kernel.handled', [$request, $response]);

        return $response;
    }
1128140
public function render($request, Exception $e)
    {
        if (str_is('api.*', $request->getHost())) {
            /** @TODO Really ugly hack to always return JSON for api */
            $request->headers->set('x-requested-with', 'XMLHttpRequest');
        }
        return parent::render($request, $e);
    }