From d87cf25ed26310a1e7db5798daf16c4fc21b7e95 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Tue, 22 Nov 2016 17:54:02 -0800 Subject: [PATCH] Display original exception and backtraces in logger output --- lib/vagrant.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/vagrant.rb b/lib/vagrant.rb index e2603026e..3db8f0897 100644 --- a/lib/vagrant.rb +++ b/lib/vagrant.rb @@ -264,6 +264,9 @@ if Vagrant.plugins_init? Vagrant::Bundler.instance.init!(plugins) rescue Exception => e global_logger.error("Plugin initialization error - #{e.class}: #{e}") + e.backtrace.each do |backtrace_line| + global_logger.debug(backtrace_line) + end raise Vagrant::Errors::PluginInitError, message: e.to_s end end @@ -330,6 +333,10 @@ if Vagrant.plugins_enabled? ::Bundler.require(:plugins) end rescue Exception => e + global_logger.error("Plugin loading error: #{e.class} - #{e}") + e.backtrace.each do |backtrace_line| + global_logger.debug(backtrace_line) + end raise Vagrant::Errors::PluginLoadError, message: e.to_s end end