[skip ci]Improve error message in schema (#10353)

Signed-off-by: Xiangyu Wang <xiangyu.wang@zilliz.com>
This commit is contained in:
Xiangyu Wang 2021-10-21 19:42:26 +08:00 committed by GitHub
parent bbd558f509
commit c3e8903dc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,7 +97,7 @@ func CreateSchemaHelper(schema *schemapb.CollectionSchema) (*SchemaHelper, error
// GetPrimaryKeyField returns the schema of the primary key
func (helper *SchemaHelper) GetPrimaryKeyField() (*schemapb.FieldSchema, error) {
if helper.primaryKeyOffset == -1 {
return nil, fmt.Errorf("no primary in schema")
return nil, fmt.Errorf("Failed to get primary key field: no primary in schema")
}
return helper.schema.Fields[helper.primaryKeyOffset], nil
}