Exception: Cask::CaskQuarantineError

Inherits:
CaskError
  • Object
show all
Defined in:
brew/Library/Homebrew/cask/exceptions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, reason) ⇒ CaskQuarantineError

Returns a new instance of CaskQuarantineError



171
172
173
174
# File 'brew/Library/Homebrew/cask/exceptions.rb', line 171

def initialize(path, reason)
  @path = path
  @reason = reason
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path



169
170
171
# File 'brew/Library/Homebrew/cask/exceptions.rb', line 169

def path
  @path
end

#reasonObject (readonly)

Returns the value of attribute reason



169
170
171
# File 'brew/Library/Homebrew/cask/exceptions.rb', line 169

def reason
  @reason
end

Instance Method Details

#to_sObject



176
177
178
179
180
181
182
183
184
185
186
# File 'brew/Library/Homebrew/cask/exceptions.rb', line 176

def to_s
  s = +"Failed to quarantine #{path}."

  unless reason.empty?
    s << " Here's the reason:\n"
    s << Formatter.error(reason)
    s << "\n" unless reason.end_with?("\n")
  end

  s.freeze
end