Catch JSON decoding errors in Apache download strategy

c.f. Homebrew/homebrew#17772.
This commit is contained in:
Jack Nagel 2013-02-11 17:14:25 -06:00
parent c16ee6f300
commit e22af69149

View File

@ -158,7 +158,7 @@ class CurlApacheMirrorDownloadStrategy < CurlDownloadStrategy
ohai "Best Mirror #{url}"
curl url, '-C', downloaded_size, '-o', @temporary_path
rescue IndexError
rescue IndexError, MultiJson::DecodeError
raise "Couldn't determine mirror. Try again later."
end
end