From b0a3cfa978d095c19e8703a8ad5d796bfef7c2c1 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Tue, 22 Nov 2016 17:54:44 -0800 Subject: [PATCH] Provide error information on plugin repair error. Also includes original exception information within logger output. --- plugins/commands/plugin/action/repair_plugins.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/plugins/commands/plugin/action/repair_plugins.rb b/plugins/commands/plugin/action/repair_plugins.rb index 3ce886b3f..9745d378b 100644 --- a/plugins/commands/plugin/action/repair_plugins.rb +++ b/plugins/commands/plugin/action/repair_plugins.rb @@ -14,14 +14,22 @@ module VagrantPlugins class RepairPlugins def initialize(app, env) @app = app + @logger = Log4r::Logger.new("vagrant::plugins::plugincommand::repair") end def call(env) env[:ui].info(I18n.t("vagrant.commands.plugin.repairing")) plugins = Vagrant::Plugin::Manager.instance.installed_plugins - Vagrant::Bundler.instance.init!(plugins, :repair) - env[:ui].info(I18n.t("vagrant.commands.plugin.repair_complete")) - + begin + Vagrant::Bundler.instance.init!(plugins, :repair) + env[:ui].info(I18n.t("vagrant.commands.plugin.repair_complete")) + rescue Exception => e + @logger.error("Failed to repair user installed plugins: #{e.class} - #{e}") + e.backtrace.each do |backtrace_line| + @logger.debug(backtrace_line) + end + env[:ui].error(I18n.t("vagrant.commands.plugin.repair_failed", message: e.message)) + end # Continue @app.call(env) end