Merge pull request #1411 from alrs/doltcore-typinfo-errs

libraries/doltcore/schema/typeinfo: fix dropped errors
This commit is contained in:
Zach Musgrave
2021-03-09 10:35:13 -08:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@@ -138,6 +138,7 @@ func testTypeInfoConvertRoundTrip(t *testing.T, tiArrays [][]TypeInfo, vaArrays
require.Equal(t, uint64(1), n)
readVal, err := ti.ReadFrom(nbf, reader)
require.NoError(t, err)
require.Equal(t, readVal, vInterface)
}
})

View File

@@ -57,6 +57,10 @@ func CreateVarStringTypeFromParams(params map[string]string) (TypeInfo, error) {
}
if maxLengthStr, ok := params[varStringTypeParam_Length]; ok {
length, err = strconv.ParseInt(maxLengthStr, 10, 64)
if err != nil {
return nil, err
}
} else {
return nil, fmt.Errorf(`create varstring type info is missing param "%v"`, varStringTypeParam_Length)
}