diff --git a/lib/vagrant/driver/virtualbox.rb b/lib/vagrant/driver/virtualbox.rb index 80069588b..4647bf8c9 100644 --- a/lib/vagrant/driver/virtualbox.rb +++ b/lib/vagrant/driver/virtualbox.rb @@ -267,8 +267,7 @@ module Vagrant # If the command was a failure, then raise an exception that is # nicely handled by Vagrant. if r.exit_code != 0 - # TODO: Inherit from VagrantError - raise Exception, "FAILURE: #{r.stderr}" + raise Errors::VBoxManageError, :command => command.inspect end # Return the output diff --git a/lib/vagrant/errors.rb b/lib/vagrant/errors.rb index 0f8ff75a9..274f2ce1f 100644 --- a/lib/vagrant/errors.rb +++ b/lib/vagrant/errors.rb @@ -300,6 +300,11 @@ module Vagrant error_key(:vagrantfile_syntax_error) end + class VBoxManageError < VagrantError + status_code(59) + error_key(:vboxmanage_error) + end + class VirtualBoxInvalidVersion < VagrantError status_code(17) error_key(:virtualbox_invalid_version) diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 59b1cdc4d..20ab73928 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -124,6 +124,13 @@ en: message is reproduced below for convenience: %{file} + vboxmanage_error: |- + There was an error executing the following command with VBoxManage: + + %{command} + + For more information on the failure, enable detailed logging with + VAGRANT_LOG. virtualbox_invalid_version: |- Vagrant has detected that you have VirtualBox version %{version} installed! Vagrant requires that you use at least VirtualBox version 4.1. Please install