//This sends the error to the client. func sendError(sendReply proto.SendBinlogResponse, reqIdentifier string, inputErr error, blpPos *proto.BinlogPosition) { var err error streamBuf := new(proto.BinlogResponse) streamBuf.Error = inputErr.Error() if blpPos != nil { streamBuf.Position = *blpPos } buf := []*proto.BinlogResponse{streamBuf} err = blsSendStream(sendReply, buf) if err != nil { log.Errorf("Error in communicating message %v with the client: %v", inputErr, err) } }