Changeset a5b6bf1 in lab.git for Dev/twitter/show_status.pl


Ignore:
Timestamp:
Jun 21, 2013 3:38:04 PM (11 years ago)
Author:
Ken-ichi Mito <mitty@…>
Branches:
master
Children:
e960958
Parents:
fd6dbd0
Message:

fix evalrescue fuction

  • dereference Net::Twitter::Lite::Error->twitter_error object correctly
  • use Data::Dumper for unknown structure
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/twitter/show_status.pl

    r43d739e ra5b6bf1  
    5858        warn $@->error; 
    5959        if ($@->twitter_error) { 
    60             my %twitter_error = %{$@->twitter_error}; 
    61             map { 
    62                 $twitter_error{"$_ => "} = $twitter_error{$_} . "\n"; 
    63                 delete $twitter_error{$_} 
    64             } keys %twitter_error; 
    65             warn join("", %twitter_error); 
     60            my $twitter_error = $@->twitter_error; 
     61            if (defined $twitter_error->{errors}) { 
     62                foreach my $error (@{$twitter_error->{errors}}) { 
     63                    warn "code => "   , $error->{code}, "\n"; 
     64                    warn "message => ", $error->{message}, "\n"; 
     65                } 
     66            } 
     67            else { 
     68                # unknown HASH structure 
     69                use Data::Dumper; 
     70                warn Dumper $twitter_error; 
     71            } 
    6672        } 
    6773    } 
Note: See TracChangeset for help on using the changeset viewer.