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
|
2009-04-30 12:33:47 -07:00
|
|
|
# The line of the template on which the error occurred.
|
|
|
|
#
|
|
|
|
# @return [Fixnum]
|
2008-05-29 01:30:29 -07:00
|
|
|
attr_reader :line
|
2008-04-17 12:35:47 -07:00
|
|
|
|
2009-04-30 12:33:47 -07:00
|
|
|
# @param message [String] The error message
|
|
|
|
# @param line [Fixnum] See \{#line}
|
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
|
|
|
|
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.
|
2009-04-30 12:33:47 -07:00
|
|
|
# It's not particularly interesting,
|
|
|
|
# except in that it's a subclass of {Haml::Error}.
|
2007-11-26 03:26:16 +00:00
|
|
|
class SyntaxError < Haml::Error; end
|
2007-01-27 10:29:14 +00:00
|
|
|
end
|