Tweak DownloadError message to include wrapped exception
This commit is contained in:
parent
c9784c1857
commit
9b8cff1484
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user