Exception: Brandish::LocationError Private

Inherits:
Error
  • Object
show all
Defined in:
lib/brandish/errors.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.

This should never be used directly. This is an error that is tied to a location; as such, it provides an initalizer for providing a location.

Direct Known Subclasses

BuildError, ParseError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, location = Location.default, bt = caller[1..-1]) ⇒ LocationError

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.

Initialize the error with the given location and message.



34
35
36
37
38
# File 'lib/brandish/errors.rb', line 34

def initialize(message, location = Location.default, bt = caller[1..-1])
  @location = location
  super(message)
  set_backtrace(bt)
end

Instance Attribute Details

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

The location of the error in a file.

Returns:

  • (Location)


31
32
33
# File 'lib/brandish/errors.rb', line 31

def location
  @location
end