Exception: Cask::CaskQuarantineError Private

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Error during quarantining of a file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, reason) ⇒ CaskQuarantineError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CaskQuarantineError.


235
236
237
238
239
240
# File 'Library/Homebrew/cask/exceptions.rb', line 235

def initialize(path, reason)
  super()

  @path = path
  @reason = reason
end

Instance Attribute Details

#pathObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


233
234
235
# File 'Library/Homebrew/cask/exceptions.rb', line 233

def path
  @path
end

#reasonObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


233
234
235
# File 'Library/Homebrew/cask/exceptions.rb', line 233

def reason
  @reason
end

Instance Method Details

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


242
243
244
245
246
247
248
249
250
251
252
# File 'Library/Homebrew/cask/exceptions.rb', line 242

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