Exception: ChecksumMismatchError

Inherits:
RuntimeError
  • Object
show all
Defined in:
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



534
535
536
537
538
539
540
541
542
543
544
545
# File 'Library/Homebrew/exceptions.rb', line 534

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



532
533
534
# File 'Library/Homebrew/exceptions.rb', line 532

def expected
  @expected
end

#hash_typeObject (readonly)

Returns the value of attribute hash_type



532
533
534
# File 'Library/Homebrew/exceptions.rb', line 532

def hash_type
  @hash_type
end