Merge pull request #1536 from alrs/doltcore-table-errs

libraries/doltcore/tables: fix two subpackage dropped errors
This commit is contained in:
Zach Musgrave
2021-04-13 15:51:03 -07:00
committed by GitHub
2 changed files with 8 additions and 2 deletions
@@ -307,6 +307,10 @@ func GetIndexedRows(ctx context.Context, te TableEditor, key types.Tuple, indexN
}
tableRow, err := row.FromNoms(te.Schema(), pkTupleVal.(types.Tuple), fieldsVal.(types.Tuple))
if err != nil {
return nil, err
}
rows = append(rows, tableRow)
}
@@ -77,7 +77,7 @@ func (jsonw *JSONWriter) GetSchema() schema.Schema {
func (jsonw *JSONWriter) WriteRow(ctx context.Context, r row.Row) error {
allCols := jsonw.sch.GetAllCols()
colValMap := make(map[string]interface{}, allCols.Size())
err := allCols.Iter(func(tag uint64, col schema.Column) (stop bool, err error) {
if err := allCols.Iter(func(tag uint64, col schema.Column) (stop bool, err error) {
val, ok := r.GetColVal(tag)
if !ok || types.IsNull(val) {
return false, nil
@@ -112,7 +112,9 @@ func (jsonw *JSONWriter) WriteRow(ctx context.Context, r row.Row) error {
colValMap[col.Name] = val
return false, nil
})
}); err != nil {
return err
}
data, err := marshalToJson(colValMap)
if err != nil {