class Jekyll::Premonition::Attributes::ParserError

Public: Custom error for Premonition attributes parser errors.

Public Class Methods

new(msg, raw = nil, pos = 0) click to toggle source

Initialize a new ParserError

msg - The error message raw - The raw string send to the parser initially.

Used for syntax error output. If nil syntax
error output is skipped.

pos - The buffer position when error was raised.

Used in both error message and syntax error output
if raw attribute is set.
Calls superclass method
# File lib/premonition/attributes/error.rb, line 19
def initialize(msg, raw = nil, pos = 0)
  if raw.nil?
    super(msg)
  else
    super("#{msg} [#{pos}:#{raw.length}]")
    print "Attribute syntax error:\n #{raw}\n"
    pos.times { print ' ' }
    print "^\n"
  end
end