Raise a proper SSH error on EHOSTUNREACH

This commit is contained in:
Emiliano Ticci 2013-07-09 14:35:07 +02:00
parent e1e57024dc
commit b0b18c64dd
3 changed files with 11 additions and 0 deletions

View File

@ -455,6 +455,10 @@ module Vagrant
error_key(:ssh_key_type_not_supported)
end
class SSHNoRoute < VagrantError
error_key(:ssh_no_route)
end
class SSHNotReady < VagrantError
error_key(:ssh_not_ready)
end

View File

@ -235,6 +235,9 @@ module VagrantPlugins
rescue Errno::EHOSTDOWN
# This is raised if we get an ICMP DestinationUnknown error.
raise Vagrant::Errors::SSHHostDown
rescue Errno::EHOSTUNREACH
# This is raised if we can't work out how to route traffic.
raise Vagrant::Errors::SSHNoRoute
rescue NotImplementedError
# This is raised if a private key type that Net-SSH doesn't support
# is used. Show a nicer error.

View File

@ -426,6 +426,10 @@ en:
usually indicates that SSH within the guest machine was unable to
properly start up. Please boot the VM in GUI mode to check whether
it is booting properly.
ssh_no_route: |-
While attempting to connect with SSH, a "no route to host" (EHOSTUNREACH)
error was received. Please verify your network settings are correct
and try again.
ssh_host_down: |-
While attempting to connect with SSH, a "host is down" (EHOSTDOWN)
error was received. Please verify your SSH settings are correct