mirror of
https://github.com/kataras/iris.git
synced 2026-01-28 14:25:57 +00:00
Add error message when reverse routing using gorillamux happens before boot
Former-commit-id: 96dd812a16338824474ba1be0db18c486b2ebc0d
This commit is contained in:
@@ -64,9 +64,15 @@ func New() iris.Policies {
|
||||
// {{ url "providerLink" "provider" "facebook"}}
|
||||
// for a path: "/auth/{provider}" with name 'providerLink'
|
||||
URLPath: func(r iris.RouteInfo, args ...string) string {
|
||||
if router == nil {
|
||||
logger(iris.ProdMode, "gorillamux' reverse routing 'URLPath' should be called after Boot/Listen/Serve")
|
||||
return ""
|
||||
}
|
||||
|
||||
if r == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
if gr := router.Get(r.Name()); gr != nil {
|
||||
u, err := gr.URLPath(args...)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user