Pull cache creation out of begin block

This commit is contained in:
Jack Nagel 2014-10-10 20:30:29 -05:00
parent b3ed5a367d
commit 3d96dad25c

View File

@ -78,12 +78,14 @@ class Resource
end
def fetch
# Ensure the cache exists
HOMEBREW_CACHE.mkpath
downloader.fetch
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
raise DownloadError.new(self, e)
else
begin
downloader.fetch
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
raise DownloadError.new(self, e)
end
cached_download
end