No need to catch action exception on downloaders. Converted to using proper environment errors.
This commit is contained in:
parent
05eec68bfb
commit
eed81d64f0
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue