From fba878f47ad1eb8bed29fede5391723c28e41a12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E4=BA=AE?= <739476267@qq.com> Date: Thu, 13 Jun 2024 21:16:11 +0800 Subject: [PATCH] net/ghttp: update error message for duplicated routes registering (#3603) --- net/ghttp/ghttp_server_router.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ghttp/ghttp_server_router.go b/net/ghttp/ghttp_server_router.go index fbba732b4..dd4e6640d 100644 --- a/net/ghttp/ghttp_server_router.go +++ b/net/ghttp/ghttp_server_router.go @@ -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, ) } }