From d9a45a4146c17de9feaa2d2fd59e2af6fa3a4f2b Mon Sep 17 00:00:00 2001 From: Ken-ichi Mito Date: Fri, 12 Jul 2013 23:37:54 +0900 Subject: [PATCH] FIX: print error message causes error * Net::Twitter::Lite::Error->twitter_error->{errors} is sometimes simple string --- Dev/twitter/twitterbot.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"; -- 1.7.9.5