diff options
author | Jaime Iniesta <jaimeiniesta@gmail.com> | 2012-08-24 12:06:44 +0200 |
---|---|---|
committer | Jaime Iniesta <jaimeiniesta@gmail.com> | 2012-08-24 12:06:44 +0200 |
commit | 14c2979aa65e37cf8b5aef340a06b2aeca9b52e5 (patch) | |
tree | 05f75b15248cea7655999c4314f95592f9295137 /guides/w3c_validator.rb | |
parent | 1b709f620762e993ea599c82e4a9c712afc16632 (diff) | |
download | rails-14c2979aa65e37cf8b5aef340a06b2aeca9b52e5.tar.gz rails-14c2979aa65e37cf8b5aef340a06b2aeca9b52e5.tar.bz2 rails-14c2979aa65e37cf8b5aef340a06b2aeca9b52e5.zip |
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.
Diffstat (limited to 'guides/w3c_validator.rb')
-rw-r--r-- | guides/w3c_validator.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/guides/w3c_validator.rb b/guides/w3c_validator.rb index 8be14fe1f5..6ef3df45a9 100644 --- a/guides/w3c_validator.rb +++ b/guides/w3c_validator.rb @@ -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 "." |