aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/exceptions.rb
diff options
context:
space:
mode:
authorDrew Rodman2014-02-18 15:08:03 -0500
committerJack Nagel2014-02-18 15:08:03 -0500
commitd63ef14794c60464108be85cb5eeedb829261cab (patch)
tree90035f324d724ab9e37a82527a823e9b61292abd /Library/Homebrew/exceptions.rb
parentca0eff67faaa3193ca05ee14f9d0af6797dd2a52 (diff)
downloadbrew-d63ef14794c60464108be85cb5eeedb829261cab.tar.bz2
Add DownloadError to catch a broader range of resource download errors.
Adding a broader exception class allows for errors raised in Resource.fetch to be caught in upgrade and prevent the process from being killed when a download fails. This should resolve issue 18364. Fixes Homebrew/homebrew#18364. Closes Homebrew/homebrew#26618. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/exceptions.rb')
-rw-r--r--Library/Homebrew/exceptions.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index 66123d9f0..926407be7 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -229,6 +229,13 @@ class CompilerSelectionError < Homebrew::InstallationError
end
end
+# Raised in Resource.fetch
+class DownloadError < RuntimeError
+ def initialize(formula)
+ super "Failed to download resource for package: #{formula}"
+ end
+end
+
# raised in CurlDownloadStrategy.fetch
class CurlDownloadStrategyError < RuntimeError; end