| Class | Sass::SyntaxError |
| In: |
lib/sass/error.rb
|
| Parent: | StandardError |
An exception class that keeps track of the line of the Sass template it was raised on and the Sass file that was being parsed (if applicable).
All Sass errors are raised as {Sass::SyntaxError}s.
| sass_filename | [R] |
The name of the file that was being parsed when the exception was raised.
This could be `nil` if no filename is available.
@return [String] |
| sass_line | [RW] |
The line of the Sass template on which the error
occurred.
@return [Fixnum] |
@param msg [String] The error message @param lineno [Fixnum] See \{sass_line}
# File lib/sass/error.rb, line 21
21: def initialize(msg, lineno = nil)
22: @message = msg
23: @sass_line = lineno
24: end
Add information about the filename and line on which the error was raised, and re-raises the exception.
@param filename [String] See \{sass_filename} @param line [Fixnum] See \{sass_line} @raise [Sass::SyntaxError] self
# File lib/sass/error.rb, line 32
32: def add_metadata(filename, line)
33: self.sass_line ||= line
34: add_backtrace_entry(filename) unless sass_filename
35: raise self
36: end