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
|
# Raised in Resource.fetch
|
||||||
class DownloadError < RuntimeError
|
class DownloadError < RuntimeError
|
||||||
def initialize(formula)
|
def initialize(resource, e)
|
||||||
super "Failed to download resource for package: #{formula}"
|
super <<-EOS.undent
|
||||||
|
Failed to download resource #{resource.download_name.inspect}
|
||||||
|
#{e.message}
|
||||||
|
EOS
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -80,7 +80,7 @@ class Resource
|
|||||||
HOMEBREW_CACHE.mkpath
|
HOMEBREW_CACHE.mkpath
|
||||||
downloader.fetch
|
downloader.fetch
|
||||||
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
|
rescue ErrorDuringExecution, CurlDownloadStrategyError => e
|
||||||
raise DownloadError.new(downloader.name)
|
raise DownloadError.new(self, e)
|
||||||
else
|
else
|
||||||
cached_download
|
cached_download
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user