robustness and etc
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 30 Jul 2006 05:44:17 +0000 (05:44 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sun, 30 Jul 2006 05:44:17 +0000 (05:44 +0000)
IkiWiki/Plugin/aggregate.pm

index 99b26a546e91adb9ed35a7fea7ecb860884d8868..75e6f31d62dcfe26b86d82558e26474a163d2087 100644 (file)
@@ -93,7 +93,7 @@ sub preprocess (@) { #{{{
 
        return "<a href=\"".$feed->{url}."\">".$feed->{name}."</a>: ".
               "<i>".$feed->{message}."</i> (".$feed->{numposts}.
-              " stored posts; ".$feed->{newposts}." new)";
+              " stored posts; ".$feed->{newposts}." new)<br />";
 } # }}}
 
 sub delete (@) { #{{{
@@ -192,9 +192,15 @@ FEED:      foreach my $feed (values %feeds) {
                if (! @urls) {
                        $feed->{message}="could not find feed at ".$feed->{feedurl};
                        IkiWiki::debug($feed->{message});
+                       next FEED;
                }
                foreach my $url (@urls) {
-                       my $f=XML::Feed->parse(URI->new($url));
+                       my $f=eval{XML::Feed->parse(URI->new($url))};
+                       if ($@) {
+                               $feed->{message}="feed crashed XML::Feed! $@";
+                               IkiWiki::debug($feed->{message});
+                               next FEED;
+                       }
                        if (! $f) {
                                $feed->{message}=XML::Feed->errstr;
                                IkiWiki::debug($feed->{message});