diff --git a/internal/msg_gateway/gate/rpc_server.go b/internal/msg_gateway/gate/rpc_server.go index 5f5d3646c..af6e62e16 100644 --- a/internal/msg_gateway/gate/rpc_server.go +++ b/internal/msg_gateway/gate/rpc_server.go @@ -254,7 +254,13 @@ func (r *RPCServer) OnlineBatchPushOneMsg(_ context.Context, req *pbRelay.Online }, nil } func (r *RPCServer) encodeWsData(wsData *sdk_ws.MsgData, operationID string) (bytes.Buffer, error) { - msgBytes, _ := proto.Marshal(wsData) + log.Debug(operationID, "encodeWsData begin", wsData.String()) + msgBytes, err := proto.Marshal(wsData) + if err != nil { + log.NewError(operationID, "Marshal", err.Error()) + return bytes.Buffer{}, utils.Wrap(err, "") + } + log.Debug(operationID, "encodeWsData begin", wsData.String()) mReply := Resp{ ReqIdentifier: constant.WSPushMsg, OperationID: operationID, @@ -262,10 +268,10 @@ func (r *RPCServer) encodeWsData(wsData *sdk_ws.MsgData, operationID string) (by } var replyBytes bytes.Buffer enc := gob.NewEncoder(&replyBytes) - err := enc.Encode(mReply) + err = enc.Encode(mReply) if err != nil { log.NewError(operationID, "data encode err", err.Error()) - return bytes.Buffer{}, err + return bytes.Buffer{}, utils.Wrap(err, "") } return replyBytes, nil }