Skip to content

Commit ed3ec0f

Browse files
committed
Merge pull request revel#880 from pbnjay/feature/friendly-url-template-errors
Friendly URL template errors
2 parents 12f5042 + ea50b4c commit ed3ec0f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

template.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,11 @@ func ReverseUrl(args ...interface{}) (template.URL, error) {
473473
return "", fmt.Errorf("reversing %s: %s", action, err)
474474
}
475475

476+
if len(c.MethodType.Args) < len(args)-1 {
477+
return "", fmt.Errorf("reversing %s: route defines %d args, but received %d",
478+
action, len(c.MethodType.Args), len(args)-1)
479+
}
480+
476481
// Unbind the arguments.
477482
argsByName := make(map[string]string)
478483
for i, argValue := range args[1:] {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy