class Sass::SyntaxError

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.

When dealing with SyntaxErrors, it’s important to provide filename and line number information. This will be used in various error reports to users, including backtraces; see {#sass_backtrace} for details.

Some of this information is usually provided as part of the constructor. New backtrace entries can be added with {#add_backtrace}, which is called when an exception is raised between files (e.g. with ‘@import`).

Often, a chunk of code will all have similar backtrace information - the same filename or even line. It may also be useful to have a default line number set. In those situations, the default values can be used by omitting the information on the original exception, and then calling {#modify_backtrace} in a wrapper ‘rescue`. When doing this, be sure that all exceptions ultimately end up with the information filled in.