Exception: Cask::CaskSha256MismatchError

Inherits:
CaskSha256Error show all
Defined in:
brew/Library/Homebrew/cask/exceptions.rb

Instance Attribute Summary collapse

Attributes inherited from CaskSha256Error

#actual, #expected

Attributes inherited from AbstractCaskErrorWithToken

#reason, #token

Instance Method Summary collapse

Constructor Details

#initialize(token, expected, actual, path) ⇒ CaskSha256MismatchError

Returns a new instance of CaskSha256MismatchError



141
142
143
144
# File 'brew/Library/Homebrew/cask/exceptions.rb', line 141

def initialize(token, expected, actual, path)
  super(token, expected, actual)
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path



139
140
141
# File 'brew/Library/Homebrew/cask/exceptions.rb', line 139

def path
  @path
end

Instance Method Details

#to_sObject



146
147
148
149
150
151
152
153
154
155
156
# File 'brew/Library/Homebrew/cask/exceptions.rb', line 146

def to_s
  <<~EOS
    Checksum for Cask '#{token}' does not match.
    Expected: #{Formatter.success(expected.to_s)}
      Actual: #{Formatter.error(actual.to_s)}
        File: #{path}
    To retry an incomplete download, remove the file above.
    If the issue persists, visit:
      #{Formatter.url("https://github.com/Homebrew/homebrew-cask/blob/master/doc/reporting_bugs/checksum_does_not_match_error.md")}
  EOS
end