Nice error message on plugin install conflict

This commit is contained in:
Mitchell Hashimoto 2014-01-05 16:28:05 -08:00
parent 8861510520
commit f8b49afe8a
3 changed files with 17 additions and 0 deletions

View File

@ -65,6 +65,9 @@ module Vagrant
end
definition.specs
rescue ::Bundler::VersionConflict => e
raise Errors::PluginInstallVersionConflict,
conflicts: e.to_s.gsub("Bundler", "Vagrant")
end
# Clean removes any unused gems.

View File

@ -440,6 +440,10 @@ module Vagrant
error_key(:plugin_install_not_found)
end
class PluginInstallVersionConflict < VagrantError
error_key(:plugin_install_version_conflict)
end
class PluginLoadError < VagrantError
error_key(:plugin_load_error)
end

View File

@ -486,6 +486,16 @@ en:
plugin_install_not_found: |-
The plugin '%{name}' could not be found in local or remote
repositories. Please check the name of the plugin and try again.
plugin_install_version_conflict: |-
The plugin(s) can't be installed due to the version conflicts below.
This means that the plugins depend on a library version that conflicts
with other plugins or Vagrant itself, creating an impossible situation
where Vagrant wouldn't be able to load the plugins.
You can fix the issue by either removing a conflicting plugin or
by contacting a plugin author to see if they can address the conflict.
%{conflicts}
plugin_load_error: |-
The plugin "%{plugin}" could not be found. Please make sure that it is
properly installed via `vagrant plugin`. Note that plugins made for