function DefaultExceptionHtmlSubscriber::on404

Same name in other branches
  1. 9 core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php \Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber::on404()
  2. 8.9.x core/lib/Drupal/Core/EventSubscriber/DefaultExceptionHtmlSubscriber.php \Drupal\Core\EventSubscriber\DefaultExceptionHtmlSubscriber::on404()
  3. 11.x 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 131

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.