Skip to content

Commit

Permalink
handle broken response better
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Mar 1, 2014
1 parent 38445c7 commit 27a2e2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/MetaCPAN/Web/Model/API.pm
Expand Up @@ -73,6 +73,10 @@ sub request {
$self->client->request($request)->cv->cb(
sub {
my ( $response, $stats ) = shift->recv;
if ( !$response ) {
$req->croak("bad response when requesting " . $request->uri);
return;
};
my $content_type = $response->header('content-type') || '';
my $data = $response->content;

Expand Down

0 comments on commit 27a2e2b

Please sign in to comment.