This commit is contained in:
meixiongfeng 2022-06-16 15:01:18 +08:00
commit 1b32f51406
2 changed files with 6 additions and 4 deletions

View File

@ -39,7 +39,7 @@ func (this *AgentMgr_Comp) Bind(ctx context.Context, args *pb.AgentBuildReq, rep
a.(IAgent).Bind(args.UserId, args.WorkerId)
} else {
reply.Code = pb.ErrorCode_UserSessionNobeing
reply.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
reply.Message = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
}
return nil
}
@ -50,7 +50,7 @@ func (this *AgentMgr_Comp) UnBind(ctx context.Context, args *pb.AgentUnBuildReq,
a.(IAgent).UnBind()
} else {
reply.Code = pb.ErrorCode_UserSessionNobeing
reply.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
reply.Message = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
}
return nil
}
@ -65,7 +65,7 @@ func (this *AgentMgr_Comp) SendMsgToAgent(ctx context.Context, args *pb.AgentSen
})
} else {
reply.Code = pb.ErrorCode_UserSessionNobeing
reply.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
reply.Message = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
}
return nil
}
@ -105,7 +105,7 @@ func (this *AgentMgr_Comp) CloseAgent(ctx context.Context, args *pb.AgentCloseeR
a.(IAgent).Close()
} else {
reply.Code = pb.ErrorCode_UserSessionNobeing
reply.Msg = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
reply.Message = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
}
return nil
}

View File

@ -135,6 +135,7 @@ func (this *SComp_GateRouteComp) ReceiveMsg(ctx context.Context, args *pb.AgentM
if code.Code != pb.ErrorCode_Success {
log.Errorf("HandleUserMsg:%s msg:%v code:%d", args.Method, msg, code)
reply.Code = code.Code
reply.Message = pb.GetErrorCodeMsg(code.Code)
if code.Data != nil {
if d, err := jsoniter.Marshal(code.Data); err != nil {
log.Errorf("HandleUserMsg:%s msg:%v code:%d err:%v", args.Method, msg, code, err)
@ -151,6 +152,7 @@ func (this *SComp_GateRouteComp) ReceiveMsg(ctx context.Context, args *pb.AgentM
if errcode != pb.ErrorCode_Success {
log.Errorf("HandleUserMsg:%s msg:%v code:%d", args.Method, msg, code)
reply.Code = errcode
reply.Message = pb.GetErrorCodeMsg(errcode)
return nil
}
} else {