net/ghttp: update error message for duplicated routes registering (#3603)

This commit is contained in:
海亮
2024-06-13 21:16:11 +08:00
committed by GitHub
parent 88f188d0f9
commit fba878f47a

View File

@ -167,8 +167,9 @@ func (s *Server) doSetHandler(
if duplicatedHandler != nil {
s.Logger().Fatalf(
ctx,
`duplicated route registry "%s" at %s , already registered at %s`,
pattern, handler.Source, duplicatedHandler.Source,
"The duplicated route registry [%s] which is meaning [{hook}%%{method}:{path}@{domain}] at \n%s -> %s , which has already been registered at \n%s -> %s"+
"\nYou can disable duplicate route detection by modifying the server.routeOverWrite configuration, but this will cause some routes to be overwritten",
routerKey, handler.Source, handler.Name, duplicatedHandler.Source, duplicatedHandler.Name,
)
}
}