]> nos-oignons.net Git - gestion-adh.git/commitdiff
Also catch Psych specific exception to identify wrong YAML
authorLunar <lunar@anargeek.net>
Fri, 7 Jun 2013 13:02:08 +0000 (15:02 +0200)
committerLunar <lunar@anargeek.net>
Fri, 7 Jun 2013 13:02:08 +0000 (15:02 +0200)
lib/nos_oignons.rb

index ff387d1af21b6ca32b2dc33deb0a09e70eaf7fb6..2a5d4143464cc3c1e8b5919465f7dc30644999bf 100644 (file)
@@ -64,7 +64,7 @@ module NosOignons
           begin
             # Use empty ref to get the index
             NosOignons::Member.read_from_git('', file)
-          rescue ArgumentError
+          rescue ArgumentError, Psych::SyntaxError
             $stderr.puts "Désolé : #{file} n'a pas le bon format !"
             exit 1
           end
@@ -80,7 +80,7 @@ module NosOignons
             next unless file.start_with?("#{NosOignons::MEMBERS_DB_DIR}/")
             begin
               NosOignons::Member.read_from_git(new_value, file)
-            rescue ArgumentError
+            rescue ArgumentError, Psych::SyntaxError
               $stderr.puts "Désolé : #{file} n'a pas le bon format !"
               exit 1
             end