Pull cache creation out of begin block
This commit is contained in:
parent
b3ed5a367d
commit
3d96dad25c
@ -78,12 +78,14 @@ class Resource
|
|||||||
end
|
end
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
# Ensure the cache exists
|
|
||||||
HOMEBREW_CACHE.mkpath
|
HOMEBREW_CACHE.mkpath
|
||||||
downloader.fetch
|
|
||||||
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
|
begin
|
||||||
raise DownloadError.new(self, e)
|
downloader.fetch
|
||||||
else
|
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
|
||||||
|
raise DownloadError.new(self, e)
|
||||||
|
end
|
||||||
|
|
||||||
cached_download
|
cached_download
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user