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.



726
727
728
729
730
731
732
733
734
735
736
# File 'exceptions.rb', line 726

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.



724
725
726
# File 'exceptions.rb', line 724

def expected
  @expected
end