improve error message checking field type in import roaring

This commit is contained in:
Matt Jaffee 2019-11-12 17:07:33 -06:00
parent 26fc621f09
commit 0e445db7ff
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF

2
api.go
View file

@ -387,7 +387,7 @@ func (api *API) ImportRoaring(ctx context.Context, indexName, fieldName string,
// only set and time fields are supported
if field.Type() != FieldTypeSet && field.Type() != FieldTypeTime {
return NewBadRequestError(errors.New("roaring import is only supported for set and time fields"))
return NewBadRequestError(errors.Errorf("roaring import is only supported for set and time fields, not '%s' fields.", field.Type()))
}
errCh := make(chan error, len(nodes))