aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-10-22 10:41:27 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-10-22 10:41:27 +0200
commite36823f79d92ba255e7296eb0a7603a4dee6ffe1 (patch)
treed83e7d89d886faf6cf5411515ee1fd23715a17e9 /lib/private/AppFramework
parente75d226fba300de48fc2c96170298e8381c931a4 (diff)
downloadnextcloud-server-e36823f79d92ba255e7296eb0a7603a4dee6ffe1.tar.gz
nextcloud-server-e36823f79d92ba255e7296eb0a7603a4dee6ffe1.zip
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>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/Routing/RouteConfig.php2
-rw-r--r--lib/private/AppFramework/Routing/RouteParser.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/AppFramework/Routing/RouteConfig.php b/lib/private/AppFramework/Routing/RouteConfig.php
index 0fde866fb7c..3986abd6d6e 100644
--- a/lib/private/AppFramework/Routing/RouteConfig.php
+++ b/lib/private/AppFramework/Routing/RouteConfig.php
@@ -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;
diff --git a/lib/private/AppFramework/Routing/RouteParser.php b/lib/private/AppFramework/Routing/RouteParser.php
index d2e41f7498e..1b3a6c1255a 100644
--- a/lib/private/AppFramework/Routing/RouteParser.php
+++ b/lib/private/AppFramework/Routing/RouteParser.php
@@ -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;