Exception: ChecksumMismatchError

Inherits:
RuntimeError
  • Object
show all
Defined in:
exceptions.rb

Overview

Raised by Pathname#verify_checksum when verification fails.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, expected, actual) ⇒ ChecksumMismatchError

Returns a new instance of ChecksumMismatchError.



664
665
666
667
668
669
670
671
672
673
674
# File 'exceptions.rb', line 664

def initialize(path, expected, actual)
  @expected = expected

  super <<~EOS
    SHA256 mismatch
    Expected: #{Formatter.success(expected.to_s)}
      Actual: #{Formatter.error(actual.to_s)}
        File: #{path}
    To retry an incomplete download, remove the file above.
  EOS
end

Instance Attribute Details

#expectedObject (readonly)

Returns the value of attribute expected.



662
663
664
# File 'exceptions.rb', line 662

def expected
  @expected
end