2007-01-27 10:29:14 +00:00
|
|
|
module Haml
|
2008-04-19 17:07:40 +00:00
|
|
|
# An exception raised by Haml code.
|
2008-04-17 19:35:47 +00:00
|
|
|
class Error < StandardError
|
|
|
|
# :stopdoc:
|
|
|
|
|
|
|
|
# By default, an error is taken to refer to the line of the template
|
|
|
|
# that was being processed when the exception was raised.
|
|
|
|
# However, if line_offset is non-zero, it's added to that line number
|
|
|
|
# to get the line to report for the error.
|
|
|
|
attr_reader :line_offset
|
|
|
|
|
|
|
|
def initialize(message = nil, line_offset = 0)
|
|
|
|
super(message)
|
|
|
|
@line_offset = line_offset
|
|
|
|
end
|
|
|
|
# :startdoc:
|
|
|
|
end
|
2007-01-27 10:29:14 +00:00
|
|
|
|
2007-01-31 06:38:23 +00:00
|
|
|
# SyntaxError is the type of exception raised when Haml encounters an
|
2007-01-27 10:29:14 +00:00
|
|
|
# ill-formatted document.
|
|
|
|
# It's not particularly interesting, except in that it includes Haml::Error.
|
2007-11-26 03:26:16 +00:00
|
|
|
class SyntaxError < Haml::Error; end
|
2007-01-27 10:29:14 +00:00
|
|
|
end
|