diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index e0daf4a489..8c9e61ad85 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