aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/download_strategy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/download_strategy.rb')
-rw-r--r--Library/Homebrew/download_strategy.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index d043ef450..f63ed98a3 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -55,9 +55,13 @@ class CurlDownloadStrategy < AbstractDownloadStrategy
unless @tarball_path.exist?
begin
_fetch
- rescue Exception
+ rescue Exception => e
ignore_interrupts { @tarball_path.unlink if @tarball_path.exist? }
- raise
+ if e.kind_of? ErrorDuringExecution
+ raise CurlDownloadStrategyError, "Download failed: #{@url}"
+ else
+ raise
+ end
end
else
puts "File already downloaded in #{File.dirname(@tarball_path)}"