Permalink
Browse files

Handle errors when RIL text API returns empty

  • Loading branch information...
1 parent 0094b99 commit 30b77653a6d232c1a994236762b36aecbe88c759 @miyagawa committed Nov 18, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/RILFeed.pm
View
@@ -1,5 +1,6 @@
package RILFeed;
use strict;
+use warnings;
use LWP::Simple;
use URI;
use XML::RSS;
@@ -74,6 +75,8 @@ sub serve_rss {
$cache->set($id => $html);
}
+ $html ||= '(Read It Later could not fetch the article)';
+
$html =~ s/&#(\d+);/chr($1)/eg;
$html =~ s!</\w+$!!; # RIL API bug

0 comments on commit 30b7765

Please sign in to comment.