Exception: ChecksumMismatchError

Inherits:
RuntimeError
  • Object
show all
Defined in:
brew/Library/Homebrew/exceptions.rb

Overview

Raised by Pathname#verify_checksum when verification fails.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fn, expected, actual) ⇒ ChecksumMismatchError

Returns a new instance of ChecksumMismatchError



568
569
570
571
572
573
574
575
576
577
578
579
# File 'brew/Library/Homebrew/exceptions.rb', line 568

def initialize(fn, expected, actual)
  @expected = expected
  @hash_type = expected.hash_type.to_s.upcase

  super <<~EOS
    #{@hash_type} mismatch
    Expected: #{expected}
      Actual: #{actual}
     Archive: #{fn}
    To retry an incomplete download, remove the file above.
  EOS
end

Instance Attribute Details

#expectedObject (readonly)

Returns the value of attribute expected



566
567
568
# File 'brew/Library/Homebrew/exceptions.rb', line 566

def expected
  @expected
end

#hash_typeObject (readonly)

Returns the value of attribute hash_type



566
567
568
# File 'brew/Library/Homebrew/exceptions.rb', line 566

def hash_type
  @hash_type
end