Exception: UsageError

Inherits:
RuntimeError
  • Object
show all
Defined in:
exceptions.rb

Overview

This class is part of an internal API. This class may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Raised when a command is used wrong.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reason = nil) ⇒ UsageError

This method is part of an internal API. This method may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns a new instance of UsageError.



10
11
12
13
14
# File 'exceptions.rb', line 10

def initialize(reason = nil)
  super

  @reason = reason
end

Instance Attribute Details

#reasonObject (readonly)

This method is part of an internal API. This method may only be used internally in repositories owned by Homebrew, except in casks or formulae. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



8
9
10
# File 'exceptions.rb', line 8

def reason
  @reason
end