Changeset 276

Show
Ignore:
Timestamp:
03/04/06 18:25:43
Author:
miyagawa
Message:

Oops, $response->is_success gives false if the response is 304. Fixed. Refs #97

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Aggregator/Simple.pm

    r274 r276  
    2727    my $response = $agent->fetch($url, $self); 
    2828 
    29     unless ($response->is_success) { 
    30         $context->log(error => "GET $url failed: " . $response->http_response->message); 
     29    if ($response->is_error) { 
     30        $context->log(error => "GET $url failed: " . 
     31                      $response->http_status . " " . 
     32                      $response->http_response->message); 
    3133        return; 
    3234    } 
  • trunk/plagger/lib/Plagger/Plugin/Subscription/OPML.pm

    r274 r276  
    3535 
    3636        my $response = Plagger::UserAgent->new->fetch($uri, $self); 
    37         unless ($response->is_success) { 
    38             $context->error("Fetch $uri failed: ". $response->http_response->message); 
     37        if ($response->is_error) { 
     38            $context->log(error => "GET $url failed: " . 
     39                          $response->http_status . " " . 
     40                          $response->http_response->message); 
    3941        } 
    4042        $xml = $response->content; 
  • trunk/plagger/lib/Plagger/UserAgent.pm

    r274 r276  
    2525# xxx 
    2626*URI::Fetch::Response::is_success = sub { $_[0]->http_response->is_success }; 
     27*URI::Fetch::Response::is_error   = sub { $_[0]->http_response->is_error }; 
    2728 
    28291;