Skip to content
Snippets Groups Projects
Commit 9b8cff14 authored by Jack Nagel's avatar Jack Nagel
Browse files

Tweak DownloadError message to include wrapped exception

parent c9784c18
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment