From bc17c790ad63504be0c44dc339d795eb1ddc29bd Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Fri, 22 Oct 2021 10:41:27 +0200 Subject: [PATCH] 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 --- lib/private/AppFramework/Routing/RouteConfig.php | 2 +- lib/private/AppFramework/Routing/RouteParser.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/AppFramework/Routing/RouteConfig.php b/lib/private/AppFramework/Routing/RouteConfig.php index 0fde866fb7cc5..3986abd6d6eaa 100644 --- a/lib/private/AppFramework/Routing/RouteConfig.php +++ b/lib/private/AppFramework/Routing/RouteConfig.php @@ -130,7 +130,7 @@ protected function processRoute(array $route, string $routeNamePrefix = ''): voi $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; diff --git a/lib/private/AppFramework/Routing/RouteParser.php b/lib/private/AppFramework/Routing/RouteParser.php index d2e41f7498eb5..1b3a6c1255a42 100644 --- a/lib/private/AppFramework/Routing/RouteParser.php +++ b/lib/private/AppFramework/Routing/RouteParser.php @@ -93,7 +93,7 @@ private function processRoute(array $route, string $appName, string $routeNamePr $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;