diff --git a/lib/vagrant/action/box/download.rb b/lib/vagrant/action/box/download.rb index 19b8751ca..e9d5c2d43 100644 --- a/lib/vagrant/action/box/download.rb +++ b/lib/vagrant/action/box/download.rb @@ -19,11 +19,9 @@ module Vagrant def call(env) @env = env - catch_action_exception(env) do - download if instantiate_downloader - end - + download if instantiate_downloader return if env.error? + @app.call(@env) cleanup diff --git a/lib/vagrant/downloaders/file.rb b/lib/vagrant/downloaders/file.rb index e0adf2ee9..38ba7bf34 100644 --- a/lib/vagrant/downloaders/file.rb +++ b/lib/vagrant/downloaders/file.rb @@ -9,7 +9,7 @@ module Vagrant def prepare(source_url) if !::File.file?(source_url) - raise Action::ActionException.new(:downloader_file_doesnt_exist, :source_url => source_url) + return env.error!(:downloader_file_doesnt_exist, :source_url => source_url) end end diff --git a/test/vagrant/downloaders/file_test.rb b/test/vagrant/downloaders/file_test.rb index 3512b9818..eb979034e 100644 --- a/test/vagrant/downloaders/file_test.rb +++ b/test/vagrant/downloaders/file_test.rb @@ -9,9 +9,9 @@ class FileDownloaderTest < Test::Unit::TestCase context "preparing" do should "raise an exception if the file does not exist" do File.expects(:file?).with(@uri).returns(false) - assert_raises(Vagrant::Action::ActionException) { - @downloader.prepare(@uri) - } + @downloader.prepare(@uri) + assert @downloader.env.error? + assert_equal :downloader_file_doesnt_exist, @downloader.env.error.first end end