Changeset 814

Show
Ignore:
Timestamp:
05/24/06 20:09:28
Author:
miyagawa
Message:

friendly error message for Frepa login failure

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/CustomFeed/Frepa.pm

    r810 r814  
    129129    my $start_url = 'http://www.frepa.livedoor.com/'; 
    130130    my $res = $self->{mech}->get($start_url); 
    131     return 0 unless $self->{mech}->success; 
     131    return unless $self->{mech}->success; 
    132132 
    133133    if ($self->{mech}->content =~ /loginside/) { 
     134        unless ($args{livedoor_id} && $args{password}) { 
     135            Plagger->context->log(error => "Error logging in using existent Cookies. Your User-Agent (" . $self->{mech}->agent . ") should strictly match with the UA used with the Cookies."); 
     136            return; 
     137        } 
     138 
    134139        Plagger->context->log(debug => "cookie not found. logging in"); 
    135140        $self->{mech}->submit_form( 
     
    141146        ); 
    142147        $self->{mech}->submit; 
    143         return 0 unless $self->{mech}->success; 
    144         return 0 if $self->{mech}->content =~ /loginside/; 
     148        return unless $self->{mech}->success; 
     149        return if $self->{mech}->content =~ /loginside/; 
    145150    } 
    146151