Tweak DownloadError message to include wrapped exception

This commit is contained in:
Jack Nagel 2014-02-18 15:08:03 -05:00
parent c9784c1857
commit 9b8cff1484
2 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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