diff options
| author | Jack Nagel | 2014-02-18 13:27:35 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-02-18 13:27:35 -0500 |
| commit | ca0eff67faaa3193ca05ee14f9d0af6797dd2a52 (patch) | |
| tree | 7456023c96709768ec7a032f399e6a3ab4f07cd3 /Library/Homebrew/exceptions.rb | |
| parent | 52f3c3b9e343f3fd7dbc860197595bed3e04dc5d (diff) | |
| download | brew-ca0eff67faaa3193ca05ee14f9d0af6797dd2a52.tar.bz2 | |
Inline static exception text to remove a rescue
Diffstat (limited to 'Library/Homebrew/exceptions.rb')
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index b03896669..66123d9f0 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -240,24 +240,20 @@ class ChecksumMissingError < ArgumentError; end # raised by Pathname#verify_checksum when verification fails class ChecksumMismatchError < RuntimeError - attr_accessor :advice - attr_reader :expected, :actual, :hash_type + attr_reader :expected, :hash_type - def initialize expected, actual + def initialize fn, expected, actual @expected = expected - @actual = actual @hash_type = expected.hash_type.to_s.upcase super <<-EOS.undent #{@hash_type} mismatch - Expected: #{@expected} - Actual: #{@actual} + Expected: #{expected} + Actual: #{actual} + Archive: #{fn} + To retry an incomplete download, remove the file above. EOS end - - def to_s - super + advice.to_s - end end class ResourceMissingError < ArgumentError |
