diff options
| author | Drew Rodman | 2014-02-18 15:08:03 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-02-18 15:08:03 -0500 | 
| commit | c9bccb21873fe765dff681b005a330553cded898 (patch) | |
| tree | 17b650de2eb15a04a2adf0c2739908a28d4bd2d1 /Library/Homebrew/resource.rb | |
| parent | a53c2ac56024d0bf5dfc2b0dac8a11d2341cc6f5 (diff) | |
| download | homebrew-c9bccb21873fe765dff681b005a330553cded898.tar.bz2 | |
Add DownloadError to catch a broader range of resource download errors.
Adding a broader exception class allows for errors raised in Resource.fetch
to be caught in upgrade and prevent the process from being killed when
a download fails. This should resolve issue 18364.
Fixes #18364.
Closes #26618.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/resource.rb')
| -rw-r--r-- | Library/Homebrew/resource.rb | 12 | 
1 files changed, 8 insertions, 4 deletions
| diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 490c5dfb4..e0daf4a48 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -76,10 +76,14 @@ class Resource    # For brew-fetch and others.    def fetch -    # Ensure the cache exists -    HOMEBREW_CACHE.mkpath -    downloader.fetch -    cached_download +    begin +      # Ensure the cache exists +      HOMEBREW_CACHE.mkpath +      downloader.fetch +      cached_download +    rescue ErrorDuringExecution, CurlDownloadStrategyError => e +      raise DownloadError.new(downloader.name) +    end    end    def verify_download_integrity fn | 
