configupgrade: Improve error message formatting

This commit is contained in:
Radek Simko 2019-05-13 13:14:59 +01:00
parent d495fb5b35
commit 81c20ed7ae
No known key found for this signature in database
GPG Key ID: 1F1C84FE689A88D7
1 changed files with 7 additions and 3 deletions

View File

@ -232,9 +232,13 @@ func (u *Upgrader) analyze(ms ModuleSources) (*analysis, error) {
}
}
providerFactories, err := u.Providers.ResolveProviders(m.PluginRequirements())
if err != nil {
return nil, fmt.Errorf("error resolving providers: %s", err)
providerFactories, errs := u.Providers.ResolveProviders(m.PluginRequirements())
if len(errs) > 0 {
var errorsMsg string
for _, err := range errs {
errorsMsg += fmt.Sprintf("\n- %s", err)
}
return nil, fmt.Errorf("error resolving providers:\n%s", errorsMsg)
}
for name, fn := range providerFactories {