Error message on ECONNRESET for box downloading via HTTP [GH-1090]

This commit is contained in:
Mitchell Hashimoto 2012-09-09 20:16:16 -07:00
parent 8c233f7d22
commit 7158445c2d
4 changed files with 13 additions and 0 deletions

View File

@ -45,6 +45,8 @@
- SSH retries in the face of a `EHOSTUNREACH` error, improving the robustness
that SSHing succeeds when booting a machine.
- Add missing translation for "saving" state on VirtualBox. [GH-1110]
- Proper error message if the remote end unexpectedly resets the connection
while downloading a box over HTTP. [GH-1090]
## 1.0.3 (May 1, 2012)

View File

@ -69,6 +69,8 @@ module Vagrant
@ui.clear_line
end
end
rescue Errno::ECONNRESET
raise Errors::DownloaderHTTPConnectReset
rescue Errno::ETIMEDOUT
raise Errors::DownloaderHTTPConnectTimeout
rescue SocketError

View File

@ -171,6 +171,10 @@ module Vagrant
error_key(:file_missing, "vagrant.downloaders.file")
end
class DownloaderHTTPConnectReset < VagrantError
error_key(:connection_reset, "vagrant.downloaders.http")
end
class DownloaderHTTPConnectTimeout < VagrantError
status_code(79)
error_key(:connection_timeout, "vagrant.downloaders.http")

View File

@ -630,6 +630,11 @@ en:
download: "Copying box to temporary location..."
file_missing: "The specified path to a file doesn't exist."
http:
connection_reset: |-
The remote server unexpectedly closed the connection. Vagrant was
unable to finish downloading the box. Please try again. If this
problem persists, please try downloading the box manually outside
of Vagrant, then adding the box from the filesystem.
connection_timeout: |-
Vagrant timed out while attempting to connect to the HTTP host.
Please check your internet and proxy settings and try again.