Commit a19d2cdd by Jon Frisby

Catch possible exceptions when annotating a file.

parent b1882bc7
......@@ -260,6 +260,7 @@ module AnnotateModels
# :exclude_factories<Symbol>:: whether to skip modification of factory files
#
def annotate(klass, file, header, options={})
begin
info = get_schema_info(klass, header, options)
did_annotate = false
model_name = klass.name.underscore
......@@ -293,6 +294,10 @@ module AnnotateModels
end
return did_annotate
rescue Exception => e
puts "Unable to annotate #{file}: #{e.message}"
puts "\t" + e.backtrace.join("\n\t") if options[:trace]
end
end
# position = :position_in_fixture or :position_in_class
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment