diff options
Diffstat (limited to 'rhautoimport-dn')
-rwxr-xr-x | rhautoimport-dn | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/rhautoimport-dn b/rhautoimport-dn index a8b9cbe..5b1bc63 100755 --- a/rhautoimport-dn +++ b/rhautoimport-dn @@ -94,8 +94,11 @@ my $yc = sprintf("%04d-%02d%02d", @broadcast_day); print "looking for files from date $y in RSS Feed\n"; print " -> $FILES_RSS_URL\n"; -my $files_feed = rhautoimport::fetch_parse_rss($FILES_RSS_URL) - or die "Error fetching feed: " . XML::Feed->errstr; +my ($files_feed, $errstr) = rhautoimport::fetch_parse_rss($FILES_RSS_URL); +unless (defined $files_feed) { + print "Error fetching feed: $errstr\n"; + exit 1; +} my $uri = ""; my $file = ""; @@ -139,8 +142,11 @@ if($uri eq "") { print "\nlooking for headlines from date $y in RSS Feed\n"; print " -> $HEADLINES_RSS_URL\n"; -my $headlines_feed = rhautoimport::fetch_parse_rss($HEADLINES_RSS_URL) - or die "Error fetching feed: " . XML::Feed->errstr; +my ($headlines_feed, $errstr) = rhautoimport::fetch_parse_rss($HEADLINES_RSS_URL); +unless (defined $headlines_feed) { + print "Error fetching feed: $errstr\n"; + exit 1; +} for my $entry ($headlines_feed->entries) { if($entry->enclosure && $entry->enclosure->type eq "audio/mpeg") { |