[Catalyst-commits] r11095 -
Catalyst-Model-XML-Feed/trunk/lib/Catalyst/Model/XML
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Mon Aug 10 07:00:27 GMT 2009
Author: rafl
Date: 2009-08-10 07:00:26 +0000 (Mon, 10 Aug 2009)
New Revision: 11095
Modified:
Catalyst-Model-XML-Feed/trunk/lib/Catalyst/Model/XML/Feed.pm
Log:
Better error handling.
Modified: Catalyst-Model-XML-Feed/trunk/lib/Catalyst/Model/XML/Feed.pm
===================================================================
--- Catalyst-Model-XML-Feed/trunk/lib/Catalyst/Model/XML/Feed.pm 2009-08-10 07:00:16 UTC (rev 11094)
+++ Catalyst-Model-XML-Feed/trunk/lib/Catalyst/Model/XML/Feed.pm 2009-08-10 07:00:26 UTC (rev 11095)
@@ -168,7 +168,8 @@
$uri = URI->new($arg2);
my $feed;
eval {
- $feed = XML::Feed->parse($uri);
+ $feed = XML::Feed->parse($uri)
+ or die XML::Feed->errstr;
};
if($@){
my @feeds = XML::Feed->find_feeds($arg2);
@@ -202,7 +203,14 @@
my $self = shift;
my $uri = shift;
my $name = shift;
- my $feed = XML::Feed->parse($uri);
+ my $feed;
+ eval {
+ $feed = XML::Feed->parse($uri)
+ or die XML::Feed->errstr;
+ };
+ if (my $err = $@) {
+ croak "Failed to parse feed $uri: $@";
+ }
$feed->title($name) if $name;
my $obj = Catalyst::Model::XML::Feed::Item->new($feed, $uri);
$name ||= $uri;
More information about the Catalyst-commits
mailing list