twitter-async icon indicating copy to clipboard operation
twitter-async copied to clipboard

Exception handling is broken

Open jgberg opened this issue 11 years ago • 5 comments

We're having serious problem with exception handling. These are probably 429 errors but we don't know since, response->code is not set. So we try to print the exception via print_r( e, true), but it consumes too much memory to actually print_r() -- it always gets a fatal PHP memory error no matter how big we make memory via ini( memory_limit, ...).

So, if you can cause some twitter exception in your testing ... especially a 429 and get it to return a proper EPI_exception that would help...

jgberg avatar Jun 17 '13 19:06 jgberg

I've got the same problem (in EpiOAuth.php). I take it's a result of the 1.1 switch over? I thought it might be a service interruption on Twitter's side? It was working last night

LeagueRivals avatar Jun 17 '13 19:06 LeagueRivals

Know if fixing #176 fixes it?

jmathai avatar Jun 17 '13 19:06 jmathai

I'm not sure how to patch this uncaught exception, I get the following error below without even trying to sign in with Twitter?

Fatal error: Uncaught exception 'EpiOAuthException' in //////htdocs/twitter-async-master/EpiOAuth.php:436 Stack trace: #0 /////htdocs/twitter-async-master/EpiOAuth.php(404): EpiOAuthException::raise(Object(EpiCurlManager), false) #1 /////htdocs/twitter-async-master/EpiOAuth.php(45): EpiOAuthResponse->__get('oauth_token') #2 /////htdocs/index.php(9): EpiOAuth->getAuthenticateUrl() #3 {main} thrown in //////htdocs/twitter-async-master/EpiOAuth.php on line 436

LeagueRivals avatar Jun 18 '13 21:06 LeagueRivals

Hi jmathai,

I'm been using the following tutorial for sign in with Twitter - http://webtutsdepot.com/2009/09/23/sign-in-with-twitter-example/

It was working fine a few days ago however it now has the Fatal error: Uncaught exception issue form the post above. I've updated the documentation for the 1.1 switch over however it's still not working. I've looked around for a solution and found the following in a prior issue but I'm not sure where it should go in the tutorial code.

try{ $twitterInfo = $twitterObj->get('/account/verify_credentials.json'); $res = $twitterInfo->response; //valid session } catch(EpiTwitterException $e){ // this catches all of the EpiTwitter* exceptions }

Any help would be greatly appreciated.

LeagueRivals avatar Jun 19 '13 10:06 LeagueRivals

Not sure what you mean by failing... but add a 2nd catch. catch( Exception $e ) {...}

On Wed, Jun 19, 2013 at 3:36 AM, Sam [email protected] wrote:

Hi jmathai,

I'm been using the following tutorial for sign in with Twitter - http://webtutsdepot.com/2009/09/23/sign-in-with-twitter-example/

It was working fine a few days ago however it now has the Fatal error: Uncaught exception issue form the post above. I've updated the documentation for the 1.1 switch over however it's still not working. I've looked around for a solution and found the following in a prior issue but I'm not sure where it should go in the tutorial code.

try{ $twitterInfo = $twitterObj->get('/account/verify_credentials.json'); $res = $twitterInfo->response; //valid session } catch(EpiTwitterException $e){ // this catches all of the EpiTwitter* exceptions }

Any help would be greatly appreciated.

— Reply to this email directly or view it on GitHubhttps://github.com/jmathai/twitter-async/issues/178#issuecomment-19675673 .

jgberg avatar Jun 19 '13 15:06 jgberg