上传网关层错误返回

This commit is contained in:
liwei1dao 2022-07-01 14:39:56 +08:00
parent a4185295d8
commit 678f62e58b

View File

@ -127,7 +127,7 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag
handlereturn := msghandle.handle.Func.Call([]reflect.Value{msghandle.rcvr, reflect.ValueOf(session), reflect.ValueOf(msg)}) handlereturn := msghandle.handle.Func.Call([]reflect.Value{msghandle.rcvr, reflect.ValueOf(session), reflect.ValueOf(msg)})
log.Debugf("[Handle Api] consumetime:%v method:%s uid:%s msg:%v", time.Since(stime), method, args.UserId, msg) log.Debugf("[Handle Api] consumetime:%v method:%s uid:%s msg:%v", time.Since(stime), method, args.UserId, msg)
errcode := pb.ErrorCode(handlereturn[0].Int()) errcode := pb.ErrorCode(handlereturn[0].Int())
errdata := handlereturn[0].Interface() errdata := handlereturn[1].Interface()
if errcode != pb.ErrorCode_Success { //处理返货错误码 返回用户错误信息 if errcode != pb.ErrorCode_Success { //处理返货错误码 返回用户错误信息
log.Errorf("[Handle Api] method:%s uid:%s msg:%v code:%d", method, msg, errcode) log.Errorf("[Handle Api] method:%s uid:%s msg:%v code:%d", method, msg, errcode)
reply.Code = errcode reply.Code = errcode