summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Cassidy <bricas@cpan.org>2011-12-08 11:48:07 -0400
committerBrian Cassidy <bricas@cpan.org>2011-12-08 11:48:07 -0400
commit982cae563e0686b3be23f27d3e18a35edef36090 (patch)
tree7e3999d19b9cbef3220de09eadd4fef67611c8c3
parentremove unused var; simplify conditions (diff)
downloadnet-http-spore-982cae563e0686b3be23f27d3e18a35edef36090.tar.gz
confess when we are unable to fetch a spec via LWP
-rw-r--r--lib/Net/HTTP/Spore.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Net/HTTP/Spore.pm b/lib/Net/HTTP/Spore.pm
index 356d376..ce56c92 100644
--- a/lib/Net/HTTP/Spore.pm
+++ b/lib/Net/HTTP/Spore.pm
@@ -121,6 +121,10 @@ sub _read_spec {
         my $req = HTTP::Request->new( GET => $spec_file );
         my $ua  = LWP::UserAgent->new();
         my $res = $ua->request($req);
+        unless( $res->is_success ) {
+            my $status = $res->status_line;
+            Carp::confess("Unabled to fetch $spec_file ($status)");
+        }
         $content = $res->content;
     }
     else {