From: Ken-ichi Mito Date: Fri, 12 Jul 2013 14:37:54 +0000 (+0900) Subject: FIX: print error message causes error X-Git-Url: http://lab.mitty.jp/git/?a=commitdiff_plain;h=d9a45a4146c17de9feaa2d2fd59e2af6fa3a4f2b;p=lab.git FIX: print error message causes error * Net::Twitter::Lite::Error->twitter_error->{errors} is sometimes simple string --- diff --git a/Dev/twitter/twitterbot.pl b/Dev/twitter/twitterbot.pl index 4606d95..a4ead6b 100755 --- a/Dev/twitter/twitterbot.pl +++ b/Dev/twitter/twitterbot.pl @@ -302,7 +302,7 @@ sub evalrescue { warn $@->error; if ($@->twitter_error) { my $twitter_error = $@->twitter_error; - if (defined $twitter_error->{errors}) { + if (defined $twitter_error->{errors} && ref($twitter_error->{errors})) { foreach my $error (@{$twitter_error->{errors}}) { warn "code => " , $error->{code}, "\n"; warn "message => ", $error->{message}, "\n";