Make the route name error more helpful

As a developer I have no clue what "Invalid route name" means. If the
exception gives me a hint I might find it easier to figure out why my
route triggers this error.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
Christoph Wurst 2021-10-22 10:41:27 +02:00
parent e75d226fba
commit e36823f79d
No known key found for this signature in database
GPG key ID: CC42AC2A7F0E56D8
2 changed files with 2 additions and 2 deletions

View file

@ -130,7 +130,7 @@ class RouteConfig {
$split = explode('#', $name, 2);
if (count($split) !== 2) {
throw new \UnexpectedValueException('Invalid route name');
throw new \UnexpectedValueException('Invalid route name: use the format foo#bar to reference FooController::bar');
}
[$controller, $action] = $split;

View file

@ -93,7 +93,7 @@ class RouteParser {
$split = explode('#', $name, 2);
if (count($split) !== 2) {
throw new \UnexpectedValueException('Invalid route name');
throw new \UnexpectedValueException('Invalid route name: use the format foo#bar to reference FooController::bar');
}
[$controller, $action] = $split;