Add exception handling to rake guides:validate

If the validation of a guide encounters an exception, inform about it
and continue with the loop to validate the rest.
This commit is contained in:
Jaime Iniesta 2012-08-24 12:06:44 +02:00
parent 1b709f6207
commit 14c2979aa6
1 changed files with 6 additions and 1 deletions

View File

@ -38,7 +38,12 @@ module RailsGuides
errors_on_guides = {}
guides_to_validate.each do |f|
results = validator.validate_file(f)
begin
results = validator.validate_file(f)
rescue Exception => e
puts "\nCould not validate #{f} because of #{e}"
next
end
if results.validity
print "."