From b667bc060067d784cb0236b7c03644738026687e Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Sun, 8 Nov 2020 13:36:05 +0000 Subject: Report the broken file rather than exploding when an advisory is invalid --- lib/MGA/Advisories.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm index 9b29342..cbabd68 100644 --- a/lib/MGA/Advisories.pm +++ b/lib/MGA/Advisories.pm @@ -170,7 +170,15 @@ sub login_bz { sub get_advisories_from_dir { my %advisories; foreach my $advfile (glob "$config->{advisories_dir}/*.adv") { - my $adv = LoadFile($advfile); + my $adv; + eval { + $adv = LoadFile($advfile); + }; + if ($@) { + print "Failed to load $advfile\n"; + print $@; + next; + } if (!$adv->{ID}) { next unless $config->{mode} eq 'qa'; $adv->{ref} = basename($advfile, ".adv"); -- cgit v1.2.1