From fb4110b5cd5bc924770671095c895c744aa15333 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Wed, 2 Mar 2022 10:19:17 -0700 Subject: gmi2email: print the URI when there's an XML::Feed exception Signed-off-by: Sean Whitton --- gmi2email | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gmi2email b/gmi2email index 8be383a..5dc819c 100755 --- a/gmi2email +++ b/gmi2email @@ -125,7 +125,14 @@ foreach my $sub (<$subs_fh>) { # so also look at the file extension if ($type =~ m{^(?:text|application)/(?:(?:atom|rss)\+)?xml} or $sub =~ /\.xml$/) { - my $feed = XML::Feed->parse(\$data); + my $feed; + #<<< + try { + $feed = XML::Feed->parse(\$data); + } catch { + die "While parsing $sub, XML::Feed exception:\n$_"; + }; + #>>> for ($feed->entries) { my $date = $_->issued // $_->modified; $date = $date->epoch if $date; -- cgit v1.2.3