diff options
| author | Jack Nagel | 2014-12-29 22:52:53 -0500 | 
|---|---|---|
| committer | Jack Nagel | 2014-12-29 22:57:45 -0500 | 
| commit | 8b51cf019d56c6ab5ab03c7bb4cf504eb7659c93 (patch) | |
| tree | 1c70ae289889286d1b0ff58b36e2722a10ff332f /Library/Homebrew/exceptions.rb | |
| parent | 912a586d15daaa9daf4c4831dc5cc9022acc2b62 (diff) | |
| download | brew-8b51cf019d56c6ab5ab03c7bb4cf504eb7659c93.tar.bz2 | |
Move exception text into exception object
Diffstat (limited to 'Library/Homebrew/exceptions.rb')
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 11 | 
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  | 
