Issue #7885 Don't raise error if response is 416

416 means there is no more bytes to download (which works only with `--continue-at -` of curl)
This commit is contained in:
Alexey Kamenskiy 2016-10-11 18:21:39 +08:00 committed by Brian Cain
parent f8be3cd009
commit cd3035e5e9
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
1 changed files with 7 additions and 3 deletions

View File

@ -294,9 +294,13 @@ module Vagrant
@logger.warn("Downloader exit code: #{result.exit_code}")
parts = result.stderr.split(/\n*curl:\s+\(\d+\)\s*/, 2)
parts[1] ||= ""
raise Errors::DownloaderError,
code: result.exit_code,
message: parts[1].chomp
if parts[1].include? "416"
# All good actually. 416 means there is no mory bytes to download
else
raise Errors::DownloaderError,
code: result.exit_code,
message: parts[1].chomp
end
end
result