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 committed by backportbot[bot]
parent 6750662047
commit 48d97fa865
2 changed files with 2 additions and 2 deletions

View file

@ -131,7 +131,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');
}
list($controller, $action) = $split;

View file

@ -94,7 +94,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');
}
list($controller, $action) = $split;