change panic message

This commit is contained in:
Jason li 2021-01-23 18:46:00 +08:00
parent 4077b6fdf0
commit 1665963ed7
2 changed files with 2 additions and 2 deletions

View File

@ -576,7 +576,7 @@ func getReflectTypeAndMethod(f interface{}) (controllerType reflect.Type, method
if len(method) == 0 {
panic("method name is empty")
} else if method[0] > 96 || method[0] < 65 {
panic("not a public method")
panic(fmt.Sprintf("%s is not a public method", method))
}
// check only one param which is the method receiver

View File

@ -961,7 +961,7 @@ func TestRouterAddRouterMethodPanicNotAMethod(t *testing.T) {
func TestRouterAddRouterMethodPanicNotPublicMethod(t *testing.T) {
method := http.MethodGet
message := "not a public method"
message := "ping is not a public method"
defer func() {
err := recover()
if err != nil { //产生了panic异常