diff --git a/core/lib/Drupal/Core/Routing/NullGenerator.php b/core/lib/Drupal/Core/Routing/NullGenerator.php index 63ad98d204b..7e72ec3967b 100644 --- a/core/lib/Drupal/Core/Routing/NullGenerator.php +++ b/core/lib/Drupal/Core/Routing/NullGenerator.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Routing; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\RequestContext; +use Symfony\Component\Routing\Exception\RouteNotFoundException; /** * No-op implementation of a Url Generator, needed for backward compatibility. @@ -15,14 +16,13 @@ use Symfony\Component\Routing\RequestContext; class NullGenerator implements UrlGeneratorInterface { public function generate($name, $parameters = array(), $absolute = FALSE) { - throw new \Exception('Method disabled. This is a dummy implementation.'); + return ''; + throw new RouteNotFoundException(); } public function setContext(RequestContext $context) { - throw new \Exception('Method disabled. This is a dummy implementation.'); } public function getContext() { - throw new \Exception('Method disabled. This is a dummy implementation.'); } }