From: Lunar <lunar@anargeek.net>
Date: Fri, 7 Jun 2013 13:02:08 +0000 (+0200)
Subject: Also catch Psych specific exception to identify wrong YAML
X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/commitdiff_plain/457001c90a8e16ee40b314e4281658238048648c?ds=inline

Also catch Psych specific exception to identify wrong YAML
---

diff --git a/lib/nos_oignons.rb b/lib/nos_oignons.rb
index ff387d1..2a5d414 100644
--- a/lib/nos_oignons.rb
+++ b/lib/nos_oignons.rb
@@ -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