diff options
| author | Jack Nagel | 2014-02-18 15:08:03 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-02-18 15:08:03 -0500 |
| commit | 9b8cff14846aeec1504f3788f9e65c374bb333d2 (patch) | |
| tree | c381b234d2a767a6577e647b628d897ea4d1c9b1 /Library | |
| parent | c9784c1857bd2d5942861199e77c0054a1013022 (diff) | |
| download | brew-9b8cff14846aeec1504f3788f9e65c374bb333d2.tar.bz2 | |
Tweak DownloadError message to include wrapped exception
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/resource.rb | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 926407be7..f88b6fc57 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -231,8 +231,11 @@ end # Raised in Resource.fetch class DownloadError < RuntimeError - def initialize(formula) - super "Failed to download resource for package: #{formula}" + def initialize(resource, e) + super <<-EOS.undent + Failed to download resource #{resource.download_name.inspect} + #{e.message} + EOS end end diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 8c9e61ad8..d1f0b91b4 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -80,7 +80,7 @@ class Resource HOMEBREW_CACHE.mkpath downloader.fetch rescue ErrorDuringExecution, CurlDownloadStrategyError => e - raise DownloadError.new(downloader.name) + raise DownloadError.new(self, e) else cached_download end |
