aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/exceptions.rb
diff options
context:
space:
mode:
authorJack Nagel2014-12-29 22:52:53 -0500
committerJack Nagel2014-12-29 22:57:45 -0500
commit5e191b0a652e23f25e69769c9bc3f8c969d76692 (patch)
tree2beb2a823089a234eb0ec605dd049604c12be2b8 /Library/Homebrew/exceptions.rb
parentab64e120d011d110b701bd9fcc1f459444bc3aae (diff)
downloadhomebrew-5e191b0a652e23f25e69769c9bc3f8c969d76692.tar.bz2
Move exception text into exception object
Diffstat (limited to 'Library/Homebrew/exceptions.rb')
-rw-r--r--Library/Homebrew/exceptions.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index a6a3380bb..66d5c33d2 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -208,7 +208,16 @@ class DownloadError < RuntimeError
end
# raised in CurlDownloadStrategy.fetch
-class CurlDownloadStrategyError < RuntimeError; end
+class CurlDownloadStrategyError < RuntimeError
+ def initialize(url)
+ case url
+ when %r[^file://(.+)]
+ super "File does not exist: #{$1}"
+ else
+ super "Download failed: #{url}"
+ end
+ end
+end
# raised by safe_system in utils.rb
class ErrorDuringExecution < RuntimeError