提交 12f2bf2d 编写于 作者: J Justin Collins

Recover from errors when parsing routes

and then assume all controller methods are actions
上级 f8c1312b
......@@ -129,7 +129,13 @@ class Scanner
#Adds parsed information to tracker.routes
def process_routes
if File.exists? "#@path/config/routes.rb"
@processor.process_routes RubyParser.new.parse(File.read("#@path/config/routes.rb"))
begin
@processor.process_routes RubyParser.new.parse(File.read("#@path/config/routes.rb"))
rescue Exception => e
tracker.error e.exception(e.message + "\nWhile processing routes.rb"), e.backtrace
warn "[Notice] Error while processing routes - assuming all public controller methods are actions."
OPTIONS[:assume_all_routes] = true
end
else
warn "[Notice] No route information found"
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册