Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jun 13, 2024

Conversation

hailaz
Copy link
Member

@hailaz hailaz commented May 24, 2024

before

2024-05-24 11:43:42.348 [FATA] {38c941d7dd4fd21776ffce2184665142} duplicated route registry "/hello1@default" at C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:22 , already registered at C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:22
Stack:
1.  github.com/gogf/template-single/internal/cmd.glob..func1
    C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:26
2.  main.main
    C:/hailaz/gomod/gf-master/template-single/main.go:12

exit status 1

after

2024-05-24 11:39:37.170 [FATA] {7c1d12c6a44fd217d1f3d408af3bcf35} The duplicated route registry [%GET:/hello@default] what is meaning [{hook}%{method}:{path}@{domain}] at
C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:22=>github.com/gogf/template-single/internal/controller/hello.(*ControllerV1).Hello1 , which has already been registered at 
C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:22=>github.com/gogf/template-single/internal/controller/hello.(*ControllerV1).Hello
You can disable duplicate route detection by modifying the server.routeOverWrite configuration, but this will cause some routes to be overwritten
Stack:
1.  github.com/gogf/template-single/internal/cmd.glob..func1
    C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:26
2.  main.main
    C:/hailaz/gomod/gf-master/template-single/main.go:12

exit status 1

before

2024-05-24 11:45:44.877 [FATA] duplicated route registry "/content/list" at C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:28 , already registered at C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:25 
Stack:
1.  github.com/gogf/template-single/internal/cmd.glob..func1
    C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:28
2.  main.main
    C:/hailaz/gomod/gf-master/template-single/main.go:12

exit status 1

after

2024-05-24 11:46:14.850 [FATA] The duplicated route registry [%ALL:/content/list@default] what is meaning [{hook}%{method}:{path}@{domain}] at 
C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:28=>github.com/gogf/template-single/internal/cmd.HelloHandler , which has already been registered at
C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:25=>github.com/gogf/template-single/internal/cmd.glob..func1.1
You can disable duplicate route detection by modifying the server.routeOverWrite configuration, but this will cause some routes to be overwritten
Stack:
1.  github.com/gogf/template-single/internal/cmd.glob..func1
    C:/hailaz/gomod/gf-master/template-single/internal/cmd/cmd.go:28
2.  main.main
    C:/hailaz/gomod/gf-master/template-single/main.go:12

exit status 1

@houseme houseme requested a review from gqcn May 27, 2024 04:02
@gqcn gqcn added the awesome It's awesome! We keep watching. label May 27, 2024
net/ghttp/ghttp_server_router.go Outdated Show resolved Hide resolved
@gqcn gqcn changed the title net/ghttp: 修复路由重复注册的错误内容不够清晰 net/ghttp: update error message for duplicated routes registering May 27, 2024
@hailaz hailaz requested a review from gqcn May 31, 2024 08:41
@gqcn gqcn merged commit fba878f into master Jun 13, 2024
46 checks passed
@gqcn gqcn deleted the fix/route-log branch June 13, 2024 13:16
@gqcn gqcn changed the title net/ghttp: update error message for duplicated routes registering refactor(net/ghttp): update error message for duplicated routes registering Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awesome It's awesome! We keep watching.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants