Exception: ChecksumMismatchError Private

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

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Raised by Pathname#verify_checksum when verification fails.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, expected, actual) ⇒ ChecksumMismatchError

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns a new instance of ChecksumMismatchError.



714
715
716
717
718
719
720
721
722
723
724
# File 'exceptions.rb', line 714

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)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



712
713
714
# File 'exceptions.rb', line 712

def expected
  @expected
end