调整服务注册时不符合接口定义的错误日志方式: glog.Warning->glog.Error

This commit is contained in:
john
2018-11-01 08:37:23 +08:00
parent cdd3d507b8
commit 35fa199c5a
2 changed files with 6 additions and 6 deletions

View File

@ -46,7 +46,7 @@ func (s *Server)BindController(pattern string, c Controller, methods...string) e
if _, ok := v.Method(i).Interface().(func()); !ok {
if methodMap != nil {
s := fmt.Sprintf(`invalid medthod definition "%s", while "func()" is required`, v.Method(i).Type().String())
glog.Warning(s)
glog.Error(s)
return errors.New(s)
}
continue
@ -97,7 +97,7 @@ func (s *Server)BindControllerMethod(pattern string, c Controller, method string
}
if _, ok := fval.Interface().(func()); !ok {
s := fmt.Sprintf(`invalid medthod definition "%s", while "func()" is required`, fval.Type().String())
glog.Warning(s)
glog.Error(s)
return errors.New(s)
}
pkgPath := t.Elem().PkgPath()
@ -136,7 +136,7 @@ func (s *Server)BindControllerRest(pattern string, c Controller) error {
}
if _, ok := v.Method(i).Interface().(func()); !ok {
s := fmt.Sprintf(`invalid medthod definition "%s", while "func()" is required`, v.Method(i).Type().String())
glog.Warning(s)
glog.Error(s)
return errors.New(s)
}
pkgName := gfile.Basename(pkgPath)

View File

@ -53,7 +53,7 @@ func (s *Server)BindObject(pattern string, obj interface{}, methods...string) er
if !ok {
if methodMap != nil {
s := fmt.Sprintf(`invalid medthod definition "%s", while "func(*Request))" is required`, v.Method(i).Type().String())
glog.Warning(s)
glog.Error(s)
return errors.New(s)
}
continue
@ -110,7 +110,7 @@ func (s *Server)BindObjectMethod(pattern string, obj interface{}, method string)
faddr, ok := fval.Interface().(func(*Request))
if !ok {
s := fmt.Sprintf(`invalid medthod definition "%s", while "func(*Request)" is required`, fval.Type().String())
glog.Warning(s)
glog.Error(s)
return errors.New(s)
}
finit := (func(*Request))(nil)
@ -165,7 +165,7 @@ func (s *Server)BindObjectRest(pattern string, obj interface{}) error {
faddr, ok := v.Method(i).Interface().(func(*Request))
if !ok {
s := fmt.Sprintf(`invalid medthod definition "%s", while "func()" is required`, v.Method(i).Type().String())
glog.Warning(s)
glog.Error(s)
return errors.New(s)
}
pkgName := gfile.Basename(pkgPath)