From ba8ef6a7ed65b5d4bbf3d92e57718faa85c3aaab Mon Sep 17 00:00:00 2001 From: Larry Shaffer Date: Thu, 6 Feb 2014 13:00:32 -0700 Subject: [PATCH] Add friendlier local file missing error Closes Homebrew/homebrew#26481. Signed-off-by: Jack Nagel --- Library/Homebrew/download_strategy.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index e7478bb4f5..e6ce3729f1 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -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) }