diff --git a/hooks/subjects.pl b/hooks/subjects.pl index 0ad91a5..19eb80d 100755 --- a/hooks/subjects.pl +++ b/hooks/subjects.pl @@ -171,11 +171,26 @@ sub tag_project } } + log INFO, "Information de l'intranet..."; # Call API - log ERROR, $_ if(API::Projects::add($project_id, $year)); + eval { + API::Projects::add($project_id, $year); + }; + if ($@) + { + if ($@ =~ /apP]roject [aA]ll?ready [eE]xists/) { + log WARN, $@; + } + else { + log ERROR, $@; + } + } # FIXME: Remove next line after 2016 piscine: ça ne devrait pas être fait à ce moment là - log ERROR, $_ if(API::Projects::gen_groups($project_id, $year)); + eval { + API::Projects::gen_groups($project_id, $year); + }; + log ERROR, $_ if($@); } else {