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

Handles a 404 error for HTML.

Parameters

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

1 method overrides DefaultExceptionHtmlSubscriber::on404()
CustomPageExceptionHtmlSubscriber::on404 in core/lib/Drupal/Core/EventSubscriber/CustomPageExceptionHtmlSubscriber.php
Handles a 404 error for HTML.

File

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

Class

DefaultExceptionHtmlSubscriber
Exception subscriber for handling core default HTML error pages.

Namespace

Drupal\Core\EventSubscriber

Code

public function on404(ExceptionEvent $event) {
  $this
    ->makeSubrequest($event, '/system/404', Response::HTTP_NOT_FOUND);
}