Skip to content

Commit a2234b0

Browse files
Fix unhelpful error in GetPrimaryKeyField (#208)
Description of changes: Replacing debugging error with more useful message By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 2b0ac06 commit a2234b0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pkg/model/crd.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,11 @@ func (r *CRD) GetPrimaryKeyField() (*Field, error) {
384384

385385
fieldNames := names.New(fieldName)
386386
fPath := fieldNames.Camel
387-
var notFound bool
388-
primaryField, notFound = r.Fields[fPath]
389-
if !notFound {
390-
return nil, fmt.Errorf("what the frick")
387+
var found bool
388+
primaryField, found = r.Fields[fPath]
389+
if !found {
390+
return nil, fmt.Errorf("could not find field with path " + fPath +
391+
" for primary key " + fieldName)
391392
}
392393
}
393394
return primaryField, nil

0 commit comments

Comments
 (0)