Proper error handling if the shared folder cannot be created [GH-604]
This commit is contained in:
parent
9cb4597a27
commit
89eb256f9d
|
@ -46,7 +46,12 @@ module Vagrant
|
|||
if !hostpath.directory? && options[:create]
|
||||
# Host path doesn't exist, so let's create it.
|
||||
@logger.debug("Host path doesn't exist, creating: #{hostpath}")
|
||||
hostpath.mkpath
|
||||
|
||||
begin
|
||||
hostpath.mkpath
|
||||
rescue Errno::EACCES
|
||||
raise Errors::SharedFolderCreateFailed, :path => hostpath.to_s
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -268,6 +268,11 @@ module Vagrant
|
|||
error_key(:scp_unavailable)
|
||||
end
|
||||
|
||||
class SharedFolderCreateFailed < VagrantError
|
||||
status_code(66)
|
||||
error_key(:shared_folder_create_failed)
|
||||
end
|
||||
|
||||
class SSHAuthenticationFailed < VagrantError
|
||||
status_code(11)
|
||||
error_key(:ssh_authentication_failed)
|
||||
|
|
|
@ -80,6 +80,14 @@ en:
|
|||
scp_unavailable: |-
|
||||
SSH server on the guest doesn't support SCP. Please install the necessary
|
||||
software to enable SCP on your guest operating system.
|
||||
shared_folder_create_failed: |-
|
||||
Failed to create the following shared folder on the host system. This is
|
||||
usually because Vagrant does not have sufficient permissions to create
|
||||
the folder.
|
||||
|
||||
%{path}
|
||||
|
||||
Please create the folder manually or specify another path to share.
|
||||
ssh_authentication_failed: |-
|
||||
SSH authentication failed! This is typically caused by the public/private
|
||||
keypair for the SSH user not being properly set on the guest VM. Please
|
||||
|
|
Loading…
Reference in New Issue