From f71ed25ee0c65d40be8775ea7ea7034f41367d7f Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Mon, 26 May 2014 15:56:35 -0400 Subject: [PATCH] rescue download failure; don't show traceback instead, give a more specific error message. Closes #4556. --- lib/cask/download.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cask/download.rb b/lib/cask/download.rb index 1fece6073d7..acbf7912b07 100644 --- a/lib/cask/download.rb +++ b/lib/cask/download.rb @@ -16,7 +16,11 @@ class Cask::Download downloader = Cask::CurlDownloadStrategy.new(cask) end downloader.clear_cache if force - downloaded_path = downloader.fetch + begin + downloaded_path = downloader.fetch + rescue StandardError + raise CaskError.new("Download failed on Cask '#{@cask}'") + end begin # this symlink helps track which downloads are ours File.symlink downloaded_path,