Skip to content

Commit 2ff1dc8

Browse files
committed
fix: improve exception message
1 parent 54ebb52 commit 2ff1dc8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

system/Router/RouteCollection.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,11 @@ protected function buildReverseRoute(string $from, array $params): string
12391239
// Build our resulting string, inserting the $params in
12401240
// the appropriate places.
12411241
foreach ($matches[0] as $index => $pattern) {
1242+
if (! isset($params[$index])) {
1243+
throw new InvalidArgumentException(
1244+
'Missing argument for "' . $pattern . '" in route "' . $from . '".'
1245+
);
1246+
}
12421247
if (! preg_match('#^' . $pattern . '$#u', $params[$index])) {
12431248
throw RouterException::forInvalidParameterType();
12441249
}

0 commit comments

Comments
 (0)