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-19 22:18:32 +00:00
|
|
|
class Error < Exception
|
2008-04-17 19:35:47 +00: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 08:30:29 +00:00
|
|
|
# However, if line is non-nil, it + 1 is used instead.
|
|
|
|
attr_reader :line
|
2008-04-17 19:35:47 +00:00
|
|
|
|
2008-05-29 08:30:29 +00:00
|
|
|
def initialize(message = nil, line = nil)
|
2008-04-17 19:35:47 +00:00
|
|
|
super(message)
|
2008-05-29 08:30:29 +00:00
|
|
|
@line = line
|
2008-04-17 19:35:47 +00: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
|