Add more descriptive error messages for plugin installation failures

Ref #378
This commit is contained in:
Zachary Yedidia
2016-10-05 18:00:05 -04:00
parent 76a328a062
commit d3d35bd9ff
2 changed files with 6 additions and 6 deletions

View File

@@ -298,13 +298,13 @@ func (pp PluginPackage) Match(text string) bool {
}
// IsInstallable returns true if the package can be installed.
func (pp PluginPackage) IsInstallable() bool {
func (pp PluginPackage) IsInstallable() error {
_, err := GetAllPluginPackages().Resolve(GetInstalledVersions(true), PluginDependencies{
&PluginDependency{
Name: pp.Name,
Range: semver.Range(func(v semver.Version) bool { return true }),
}})
return err == nil
return err
}
// SearchPlugin retrieves a list of all PluginPackages which match the given search text and
@@ -320,7 +320,7 @@ pluginLoop:
}
}
if pp.IsInstallable() {
if err := pp.IsInstallable(); err == nil {
plugins = append(plugins, pp)
}
}