Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. HttpKernel.php

function HttpKernel::terminateWithException

@internal

File

vendor/symfony/http-kernel/HttpKernel.php, line 123

Class

HttpKernel
HttpKernel notifies events to convert a Request object to a Response one.

Namespace

Symfony\Component\HttpKernel

Code

public function terminateWithException(\Throwable $exception, ?Request $request = null) : void {
    if (!($request ??= $this->requestStack
        ->getMainRequest())) {
        throw $exception;
    }
    if ($pop = $request !== $this->requestStack
        ->getMainRequest()) {
        $this->requestStack
            ->push($request);
    }
    try {
        $response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST);
    } finally {
        if ($pop) {
            $this->requestStack
                ->pop();
        }
    }
    $response->sendHeaders();
    $response->sendContent();
    $this->terminate($request, $response);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal