Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update bin/cif_feedparser

fix for cif_feedparser so un-par-sable feeds don't break the system
  • Loading branch information...
commit 25dc272397ba5f8817cc2e64eed4d9cea551c594 1 parent 5078c85
@wesyoung wesyoung authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 bin/cif_feedparser
View
10 bin/cif_feedparser
@@ -31,6 +31,7 @@ use Getopt::Std;
use CIF::FeedParser;
use Config::Simple;
use Data::Dumper;
+use Try::Tiny;
my %opts;
getopts('hs:T:t:dFc:f:',\%opts);
@@ -97,11 +98,16 @@ if($sconfig && $sconfig->param(-block => 'database')){
$c->{'database'} = ['DBI:'.$sconfig->{'driver'}.':database='.$sconfig->{'database'}.';host='.$sconfig->{'host'},$sconfig->{'user'},$sconfig->{'password'},{AutoCommit => 1}];
}
-my ($err,$items) = CIF::FeedParser->parse($c);
+my ($err,$items);
+try {
+ ($err,$items) = CIF::FeedParser->parse($c);
+} catch {
+ $err = shift;
+}
if($err){
unless($err =~ /no content/){
warn($err);
- exit(-1);
+ warn('skipping...');
}
exit(0);
}
Please sign in to comment.
Something went wrong with that request. Please try again.