diff --git a/lib/vagrant/action/warden.rb b/lib/vagrant/action/warden.rb index 77190100e..3d509d5c0 100644 --- a/lib/vagrant/action/warden.rb +++ b/lib/vagrant/action/warden.rb @@ -23,7 +23,9 @@ module Vagrant raise Errors::VagrantInterrupt.new if env.interrupted? @stack.unshift(@actions.shift).first.call(env) raise Errors::VagrantInterrupt.new if env.interrupted? - rescue + rescue Exception => e + env["vagrant.error"] = e + # Something went horribly wrong. Start the rescue chain then # reraise the exception to properly kick us out of limbo here. begin_rescue(env) diff --git a/test/vagrant/action/warden_test.rb b/test/vagrant/action/warden_test.rb index 6e8015057..72377afa7 100644 --- a/test/vagrant/action/warden_test.rb +++ b/test/vagrant/action/warden_test.rb @@ -63,7 +63,10 @@ class ActionWardenTest < Test::Unit::TestCase end @instance.actions << Foo.new - @instance.expects(:begin_rescue) + @instance.expects(:begin_rescue).with() do |env| + assert env["vagrant.error"].is_a?(RuntimeError) + true + end assert_raises(RuntimeError) { @instance.call(new_env) } end