Skip to content

Commit

Permalink
Return type loading errors in config.Binder.FindObject
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieupost committed May 6, 2021
1 parent 5ad012e commit f0ccab7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions codegen/config/binder.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ func (b *Binder) FindObject(pkgName string, typeName string) (types.Object, erro

pkg := b.pkgs.LoadWithTypes(pkgName)
if pkg == nil {
err := b.pkgs.Errors()
if err != nil {
return nil, errors.Wrapf(err, "package could not be loaded: %s", fullName)
}
return nil, errors.Errorf("required package was not loaded: %s", fullName)
}

Expand Down

0 comments on commit f0ccab7

Please sign in to comment.