Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge 85a1ddf into b838a5d
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasKuehneEllerhold committed Nov 14, 2019
2 parents b838a5d + 85a1ddf commit bf8f988
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
28 changes: 27 additions & 1 deletion src/Helper/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,33 @@ public function __invoke($name = null, $params = [], $options = [], $reuseMatche

$options['name'] = $name;

return $this->router->assemble($params, $options);
try {
return $this->router->assemble($params, $options);
} catch (\Zend\Router\Exception\InvalidArgumentException $e) {
throw new Exception\InvalidArgumentException(
sprintf(
'Couldnt create URL for route "%s", params "%s" and options "%s": %s',
$name,
json_encode($params),
json_encode($options),
$e->getMessage()
),
$e->getCode(),
$e
);
} catch (\Zend\Router\Exception\RuntimeException $e) {
throw new Exception\RuntimeException(
sprintf(
'Couldnt create URL for route "%s", params "%s" and options "%s": %s',
$name,
json_encode($params),
json_encode($options),
$e->getMessage()
),
$e->getCode(),
$e
);
}
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/HelperPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class HelperPluginManager extends AbstractPluginManager
Helper\Asset::class => Helper\Service\AssetFactory::class,
Helper\FlashMessenger::class => Helper\Service\FlashMessengerFactory::class,
Helper\Identity::class => Helper\Service\IdentityFactory::class,
Helper\BasePath::class => InvokableFactory::class,
Helper\BasePath::class => InvokableFactory::class, // overridden in ViewHelperManagerFactory
Helper\Cycle::class => InvokableFactory::class,
Helper\DeclareVars::class => InvokableFactory::class,
Helper\Doctype::class => InvokableFactory::class, // overridden in ViewHelperManagerFactory
Expand Down Expand Up @@ -184,7 +184,7 @@ class HelperPluginManager extends AbstractPluginManager
Helper\RenderChildModel::class => InvokableFactory::class,
Helper\RenderToPlaceholder::class => InvokableFactory::class,
Helper\ServerUrl::class => InvokableFactory::class,
Helper\Url::class => InvokableFactory::class,
Helper\Url::class => InvokableFactory::class, // overridden in ViewHelperManagerFactory
Helper\ViewModel::class => InvokableFactory::class,

// v2 canonical FQCNs
Expand Down

0 comments on commit bf8f988

Please sign in to comment.