Changeset 1977

Show
Ignore:
Timestamp:
09/26/06 04:57:11
Author:
miyagawa
Message:

Better API failure message

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • misc/30boxes.pl

    r1976 r1977  
    198198    my $data = XML::Simple::XMLin($res->content, ForceArray => [ 'event', 'tags' ], KeyAttr => undef); 
    199199    if ($data->{stat} ne 'ok') { 
    200         die "call API failed. You might need to remove $conf to redo the authentication."; 
     200        my $msg = "call API failed: $data->{err}->{msg} ($data->{err}->{code})\n"; 
     201        if ($data->{err}->{code} == 2 || $data->{err}->{code} == 5) { 
     202            $msg .= "You might need to remove $conf to authenticate again.\n"; 
     203        } 
     204        die $msg; 
    201205    } 
    202206