public ParamConversionEnhancer::onException(GetResponseForExceptionEvent $event)
Catches failed parameter conversions and throw a 404 instead.
\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event:
public function onException(GetResponseForExceptionEvent $event) { $exception = $event->getException(); if ($exception instanceof ParamNotConvertedException) { $event->setException(new NotFoundHttpException($exception->getMessage(), $exception)); } }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Routing!Enhancer!ParamConversionEnhancer.php/function/ParamConversionEnhancer::onException/8.1.x