aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Library/Homebrew/resource.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb
index e0daf4a48..8c9e61ad8 100644
--- a/Library/Homebrew/resource.rb
+++ b/Library/Homebrew/resource.rb
@@ -76,14 +76,13 @@ class Resource
# For brew-fetch and others.
def fetch
- begin
- # Ensure the cache exists
- HOMEBREW_CACHE.mkpath
- downloader.fetch
- cached_download
- rescue ErrorDuringExecution, CurlDownloadStrategyError => e
- raise DownloadError.new(downloader.name)
- end
+ # Ensure the cache exists
+ HOMEBREW_CACHE.mkpath
+ downloader.fetch
+ rescue ErrorDuringExecution, CurlDownloadStrategyError => e
+ raise DownloadError.new(downloader.name)
+ else
+ cached_download
end
def verify_download_integrity fn