summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-03-02 10:19:17 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-03-02 10:19:50 -0700
commitfb4110b5cd5bc924770671095c895c744aa15333 (patch)
tree88be93c9df9db336ba93441eb25dcf829c1a8c28
parent623ad9228948aebce3696c3b3163c1405498710e (diff)
downloadmailscripts-fb4110b5cd5bc924770671095c895c744aa15333.tar.gz
gmi2email: print the URI when there's an XML::Feed exception
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rwxr-xr-xgmi2email9
1 files changed, 8 insertions, 1 deletions
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;