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
|
# If the command was a failure, then raise an exception that is
|
||||||
# nicely handled by Vagrant.
|
# nicely handled by Vagrant.
|
||||||
if r.exit_code != 0
|
if r.exit_code != 0
|
||||||
# TODO: Inherit from VagrantError
|
raise Errors::VBoxManageError, :command => command.inspect
|
||||||
raise Exception, "FAILURE: #{r.stderr}"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Return the output
|
# Return the output
|
||||||
|
|
|
@ -300,6 +300,11 @@ module Vagrant
|
||||||
error_key(:vagrantfile_syntax_error)
|
error_key(:vagrantfile_syntax_error)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
class VBoxManageError < VagrantError
|
||||||
|
status_code(59)
|
||||||
|
error_key(:vboxmanage_error)
|
||||||
|
end
|
||||||
|
|
||||||
class VirtualBoxInvalidVersion < VagrantError
|
class VirtualBoxInvalidVersion < VagrantError
|
||||||
status_code(17)
|
status_code(17)
|
||||||
error_key(:virtualbox_invalid_version)
|
error_key(:virtualbox_invalid_version)
|
||||||
|
|
|
@ -124,6 +124,13 @@ en:
|
||||||
message is reproduced below for convenience:
|
message is reproduced below for convenience:
|
||||||
|
|
||||||
%{file}
|
%{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: |-
|
virtualbox_invalid_version: |-
|
||||||
Vagrant has detected that you have VirtualBox version %{version} installed!
|
Vagrant has detected that you have VirtualBox version %{version} installed!
|
||||||
Vagrant requires that you use at least VirtualBox version 4.1. Please install
|
Vagrant requires that you use at least VirtualBox version 4.1. Please install
|
||||||
|
|
Loading…
Reference in New Issue