From 14c2979aa65e37cf8b5aef340a06b2aeca9b52e5 Mon Sep 17 00:00:00 2001 From: Jaime Iniesta Date: Fri, 24 Aug 2012 12:06:44 +0200 Subject: [PATCH] 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. --- guides/w3c_validator.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 "."