Nice error messages if VBoxManage command fails
This commit is contained in:
parent
0aae0dd588
commit
306945dd26
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue