Exception: Hbc::CaskSha256MismatchError

Inherits:
CaskSha256Error show all
Defined in:
Library/Homebrew/cask/lib/hbc/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



145
146
147
148
# File 'Library/Homebrew/cask/lib/hbc/exceptions.rb', line 145

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

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path



143
144
145
# File 'Library/Homebrew/cask/lib/hbc/exceptions.rb', line 143

def path
  @path
end

Instance Method Details

#to_sObject



150
151
152
153
154
155
156
157
158
159
160
# File 'Library/Homebrew/cask/lib/hbc/exceptions.rb', line 150

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.
  EOS
end