Return an error if the provider is not usable

This commit is contained in:
sophia 2022-09-20 14:33:43 -04:00
parent 7403835511
commit 3be4eacaa9

View File

@ -392,11 +392,14 @@ func (p *Project) DefaultProvider(opts *core.DefaultProviderOptions) (string, er
if opts.CheckUsable {
logger.Debug("Checking usable on provider", "provider", pp.Name)
pluginImpl := plug.Plugin.(core.Provider)
usable, _ := pluginImpl.Usable()
usable, err := pluginImpl.Usable()
if !usable {
logger.Debug("Skipping unusable provider", "provider", pp.Name)
continue
}
if err != nil {
return "", err
}
}
// If we made it here we have a candidate usable provider