Exception: Cask::CaskQuarantineError Private

Inherits:
CaskError
  • Object
show all
Extended by:
T::Sig
Defined in:
cask/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.

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. 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 CaskQuarantineError.



239
240
241
242
243
244
# File 'cask/exceptions.rb', line 239

def initialize(path, reason)
  super()

  @path = path
  @reason = reason
end

Instance Attribute Details

#pathObject (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.



237
238
239
# File 'cask/exceptions.rb', line 237

def path
  @path
end

#reasonObject (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.



237
238
239
# File 'cask/exceptions.rb', line 237

def reason
  @reason
end

Instance Method Details

#to_sString

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:



247
248
249
250
251
252
253
254
255
256
257
# File 'cask/exceptions.rb', line 247

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