Add friendlier local file missing error

Closes Homebrew/homebrew#26481.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Larry Shaffer 2014-02-06 13:00:32 -07:00 committed by Jack Nagel
parent ccf37d5ac0
commit ba8ef6a7ed

View File

@ -113,7 +113,12 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
had_incomplete_download = false
retry
else
raise CurlDownloadStrategyError, "Download failed: #{@url}"
if @url =~ %r[^file://]
msg = "File does not exist: #{@url.sub(%r[^file://], "")}"
else
msg = "Download failed: #{@url}"
end
raise CurlDownloadStrategyError, msg
end
end
ignore_interrupts { temporary_path.rename(tarball_path) }