lib/slim_lint/engine.rb in slim_lint-0.5.0 vs lib/slim_lint/engine.rb in slim_lint-0.6.0

- old
+ new

@@ -26,8 +26,18 @@ # Parses the given source code into a Sexp. # # @param source [String] source code to parse # @return [SlimLint::Sexp] parsed Sexp - alias_method :parse, :call + def parse(source) + call(source) + rescue ::Slim::Parser::SyntaxError => ex + # Convert to our own exception type to isolate from upstream changes + error = SlimLint::Exceptions::ParseError.new(ex.error, + ex.file, + ex.line, + ex.lineno, + ex.column) + raise error + end end end