lib/spf/error.rb in spf-0.0.24 vs lib/spf/error.rb in spf-0.0.25
- old
+ new
@@ -30,10 +30,18 @@
# Parser Errors
##############################################################################
class NothingToParseError < Error; end # Nothing to parse
- class SyntaxError < Error; end # Generic syntax error
+ class SyntaxError < Error # Generic syntax error
+ attr_accessor :text, :parse_text
+ def initialize(message, text=nil, parse_text=nil)
+ @text = text
+ @parse_text = parse_text
+ super(message)
+ end
+ end
+
class InvalidRecordVersionError < SyntaxError; end # Invalid record version
class InvalidScopeError < SyntaxError; end # Invalid scope
class JunkInRecordError < SyntaxError; end # Junk encountered in record
class InvalidModError < SyntaxError; end # Invalid modifier
class InvalidTermError < SyntaxError; end # Invalid term