Skip to content

Commit b157276

Browse files
committed
Suppress SyntaxError during RubyVM::AST.of
When the original source code is erb, RubyVM::AST.of does not work well. rails/rails#42678.
1 parent 2dca144 commit b157276

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/error_highlight/core_ext.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def to_s
2929

3030
spot = ErrorHighlight.spot(node, **opts)
3131

32-
rescue Errno::ENOENT
32+
rescue Errno::ENOENT, SyntaxError
3333
end
3434

3535
if spot

0 commit comments

Comments
 (0)