2012-10-04 63 views
0

我试图使用该库jmathai/twitter-async发微博,但我得到一个不带消息:异常在Twitter的异步

//not logged in: 
if($oauth_token == '') 
{ 
    try 
    { 

     $authorizationUrl = $twitterObj->getAuthorizeUrl(); 
     /* 
     if (isset($authorizationUrl)) 
     { 
      $twitterMessage = '<p>'._('twitter.signin.message').' : '. 
      '<a href="'. $authorizationUrl. '">'. 
      '<img class="signin" src="images/sign-in.png" /></a></p>'; 
     } 
     else 
     { 
     $twitterMessage .= '<p>'._('twitter.error.message').' (error 1)</p>'; 
     } 
     */ 
    } 
    catch(EpiTwitterException $e) 
    { 
       $twitterMessage .= 'epiError '.$e->getCode() . ' ' . $e->getMessage(); 
    } 
    catch(EpiOAuthException $e) 
    { 
       $twitterMessage .= 'oAutherror: '$e->getCode() . ' ' . $e->getMessage(); 
    } 
} 

这反映出“oAutherror:0”

这里的的var_dump($e->getTrace());结果:

array(3) { 
    [0]=> 
    array(6) { 
    ["file"]=> 
    string(70) "/.../lib/jmathai-twitter-async/EpiOAuth.php" 
    ["line"]=> 
    int(404) 
    ["function"]=> 
    string(5) "raise" 
    ["class"]=> 
    string(17) "EpiOAuthException" 
    ["type"]=> 
    string(2) "::" 
    ["args"]=> 
    array(2) { 
     [0]=> 
     object(EpiCurlManager)#3 (2) { 
     ["key:private"]=> 
     string(14) "Resource id #8" 
     ["epiCurl:private"]=> 
     object(EpiCurl)#2 (9) { 
      ["mc:private"]=> 
      resource(7) of type (curl) 
      ["msgs:private"]=> 
      NULL 
      ["running:private"]=> 
      NULL 
      ["execStatus:private"]=> 
      NULL 
      ["selectStatus:private"]=> 
      NULL 
      ["sleepIncrement:private"]=> 
      float(1.1) 
      ["requests:private"]=> 
      array(1) { 
      ["Resource id #8"]=> 
      resource(8) of type (Unknown) 
      } 
      ["responses:private"]=> 
      array(1) { 
      ["Resource id #8"]=> 
      array(6) { 
       ["data"]=> 
       bool(false) 
       ["code"]=> 
       int(0) 
       ["time"]=> 
       float(0) 
       ["length"]=> 
       float(0) 
       ["type"]=> 
       bool(false) 
       ["url"]=> 
       string(43) "https://api.twitter.com/oauth/request_token" 
      } 
      } 
      ["properties:private"]=> 
      array(5) { 
      ["code"]=> 
      int(2097154) 
      ["time"]=> 
      int(3145731) 
      ["length"]=> 
      int(3145743) 
      ["type"]=> 
      int(1048594) 
      ["url"]=> 
      int(1048577) 
      } 
     } 
     } 
     [1]=> 
     bool(false) 
    } 
    } 
    [1]=> 
    array(6) { 
    ["file"]=> 
    string(70) "/.../lib/jmathai-twitter-async/EpiOAuth.php" 
    ["line"]=> 
    int(53) 
    ["function"]=> 
    string(5) "__get" 
    ["class"]=> 
    string(16) "EpiOAuthResponse" 
    ["type"]=> 
    string(2) "->" 
    ["args"]=> 
    array(1) { 
     [0]=> 
     string(11) "oauth_token" 
    } 
    } 
    [2]=> 
    array(6) { 
    ["file"]=> 
    string(44) "/.../main.inc.php" 
    ["line"]=> 
    int(29) 
    ["function"]=> 
    string(15) "getAuthorizeUrl" 
    ["class"]=> 
    string(8) "EpiOAuth" 
    ["type"]=> 
    string(2) "->" 
    ["args"]=> 
    array(0) { 
    } 
    } 
+1

尝试打印堆栈跟踪---加上'的var_dump($ E-> getTrace());'你第二个catch块。 – rodion

回答