优化错误日志

This commit is contained in:
duanhf2012
2021-09-10 10:53:49 +08:00
parent 4460aa4b1f
commit 0f7b0b1895

View File

@@ -316,10 +316,15 @@ func (handler *RpcHandler) CallMethod(ServiceMethod string,param interface{},rep
func (handler *RpcHandler) goRpc(processor IRpcProcessor,bCast bool,nodeId int,serviceMethod string,args interface{}) error {
var pClientList [maxClusterNode]*Client
err,count := handler.funcRpcClient(nodeId,serviceMethod,pClientList[:])
if count==0||err != nil {
log.SError("Call ",serviceMethod," is error:",err.Error())
if count==0 {
if err != nil {
log.SError("Call ",serviceMethod," is error:",err.Error())
}else{
log.SError("Can not find ",serviceMethod)
}
return err
}
if count > 1 && bCast == false{
log.SError("Cannot call %s more then 1 node!",serviceMethod)
return errors.New("cannot call more then 1 node")