From 457001c90a8e16ee40b314e4281658238048648c Mon Sep 17 00:00:00 2001 From: Lunar Date: Fri, 7 Jun 2013 15:02:08 +0200 Subject: [PATCH] Also catch Psych specific exception to identify wrong YAML --- lib/nos_oignons.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.5