Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved reporting for HTTP errors.

  • Loading branch information...
commit 4b89c04786381e1127c339a475bac054d91a42d9 1 parent e33bf2e
@davorg authored
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/Perlanet.pm
View
11 lib/Perlanet.pm
@@ -174,7 +174,16 @@ sub fetch_feeds {
for my $feed (@feeds) {
my $response = $self->fetch_page($feed->url);
- next if $response->is_error;
+ if ($response->is_error) {
+ carp 'Error retrieving ' . $feed->url;
+ carp $response->http_response->status_line;
+ next;
+ }
+
+ unless (length $response->content) {
+ carp 'No data returned from ' . $feed->url;
+ next;
+ }
try {
my $data = $response->content;
Please sign in to comment.
Something went wrong with that request. Please try again.