You are here

public function DefaultExceptionHtmlSubscriber::on4xx in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php \Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber::on4xx()

Handles a 4xx error for HTML.

Parameters

\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event: The event to process.

File

core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php, line 89

Class

DefaultExceptionHtmlSubscriber
Exception subscriber for handling core default HTML error pages.

Namespace

Drupal\Core\EventSubscriber

Code

public function on4xx(GetResponseForExceptionEvent $event) {
  if (($exception = $event
    ->getException()) && $exception instanceof HttpExceptionInterface) {
    $this
      ->makeSubrequest($event, '/system/4xx', $exception
      ->getStatusCode());
  }
}