Changeset 274

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

Aggregator::Simple and Subscription::OPML: Fixed bug handling non-reachable URL. Fixes #97.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/Makefile.PL

    r267 r274  
    1818requires('LWP' => 0); 
    1919requires('HTML::Parser' => 3.40); 
    20 requires('URI::Fetch' => 0.04); 
     20requires('URI::Fetch' => 0.05); 
    2121requires('Cache::Cache' => 1.04); 
    2222 
  • trunk/plagger/lib/Plagger/Plugin/Aggregator/Simple.pm

    r267 r274  
    2727    my $response = $agent->fetch($url, $self); 
    2828 
    29     unless ($response) { 
    30         $context->log(error => "GET $url failed: " . $response->status); 
     29    unless ($response->is_success) { 
     30        $context->log(error => "GET $url failed: " . $response->http_response->message); 
    3131        return; 
    3232    } 
  • trunk/plagger/lib/Plagger/Plugin/Subscription/OPML.pm

    r238 r274  
    3535 
    3636        my $response = Plagger::UserAgent->new->fetch($uri, $self); 
    37         unless ($response) { 
    38             $context->error("Fetch $uri failed: ". $response->status); 
     37        unless ($response->is_success) { 
     38            $context->error("Fetch $uri failed: ". $response->http_response->message); 
    3939        } 
    4040        $xml = $response->content; 
  • trunk/plagger/lib/Plagger/UserAgent.pm

    r238 r274  
    1919        UserAgent => $self, 
    2020        $plugin ? (Cache => $plugin->cache) : (), 
     21        ForceResponse => 1, 
    2122    ); 
    2223} 
    2324 
     25# xxx 
     26*URI::Fetch::Response::is_success = sub { $_[0]->http_response->is_success }; 
     27 
    24281; 
    2529