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.
18 19 20 21 22 |
# File 'lib/sassc/error.rb', line 18 def initialize(, filename: nil, line: nil) @filename = filename @line = line super() end |
Instance Method Details
#backtrace ⇒ Object
24 25 26 27 |
# File 'lib/sassc/error.rb', line 24 def backtrace return nil if super.nil? sass_backtrace + super end |
#sass_backtrace ⇒ Object
The backtrace of the error within Sass files.
30 31 32 33 |
# File 'lib/sassc/error.rb', line 30 def sass_backtrace return [] unless @filename && @line ["#{@filename}:#{@line}"] end |