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.


582
583
584
585
586
587
588
589
590
591
592
593
# File 'Library/Homebrew/exceptions.rb', line 582

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


580
581
582
# File 'Library/Homebrew/exceptions.rb', line 580

def expected
  @expected
end

#hash_typeObject (readonly)

Returns the value of attribute hash_type


580
581
582
# File 'Library/Homebrew/exceptions.rb', line 580

def hash_type
  @hash_type
end