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.

Methods

add_metadata   new   to_s  

Attributes

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]

Public Class methods

@param msg [String] The error message @param lineno [Fixnum] See \{sass_line}

[Source]

    # File lib/sass/error.rb, line 21
21:     def initialize(msg, lineno = nil)
22:       @message = msg
23:       @sass_line = lineno
24:     end

Public Instance methods

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

[Source]

    # 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

@return [String] The error message

[Source]

    # File lib/sass/error.rb, line 49
49:     def to_s
50:       @message
51:     end

[Validate]