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.


558
559
560
561
562
563
564
565
566
567
568
569
# File 'Library/Homebrew/exceptions.rb', line 558

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


556
557
558
# File 'Library/Homebrew/exceptions.rb', line 556

def expected
  @expected
end

#hash_typeObject (readonly)

Returns the value of attribute hash_type


556
557
558
# File 'Library/Homebrew/exceptions.rb', line 556

def hash_type
  @hash_type
end