2007-01-27 10:29:14 +00:00
|
|
|
module Haml
|
2008-04-19 10:07:40 -07:00
|
|
|
# An exception raised by Haml code.
|
2008-08-29 20:40:42 -07:00
|
|
|
class Error < StandardError
|
2008-04-17 12:35:47 -07:00
|
|
|
# :stopdoc:
|
|
|
|
|
|
|
|
# By default, an error is taken to refer to the line of the template
|
|
|
|
# that was being processed when the exception was raised.
|
2008-05-29 01:30:29 -07:00
|
|
|
# However, if line is non-nil, it + 1 is used instead.
|
|
|
|
attr_reader :line
|
2008-04-17 12:35:47 -07:00
|
|
|
|
2008-05-29 01:30:29 -07:00
|
|
|
def initialize(message = nil, line = nil)
|
2008-04-17 12:35:47 -07:00
|
|
|
super(message)
|
2008-05-29 01:30:29 -07:00
|
|
|
@line = line
|
2008-04-17 12:35:47 -07:00
|
|
|
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
|