Exception: SassC::SyntaxError
- Defined in:
- lib/sassc/error.rb
Overview
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;
Instance Method Summary collapse
- #backtrace ⇒ Object
-
#initialize(message, filename: nil, line: nil) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
-
#sass_backtrace ⇒ Object
The backtrace of the error within Sass files.
Constructor Details
#initialize(message, filename: nil, line: nil) ⇒ SyntaxError
Returns a new instance of SyntaxError.
14 15 16 17 18 |
# File 'lib/sassc/error.rb', line 14 def initialize(, filename: nil, line: nil) @filename = filename @line = line super() end |
Instance Method Details
#backtrace ⇒ Object
20 21 22 23 |
# File 'lib/sassc/error.rb', line 20 def backtrace return nil if super.nil? sass_backtrace + super end |
#sass_backtrace ⇒ Object
The backtrace of the error within Sass files.
26 27 28 29 |
# File 'lib/sassc/error.rb', line 26 def sass_backtrace return [] unless @filename && @line ["#{@filename}:#{@line}"] end |