2012-05-07 94 views
31

我在哪里可以找到官方图形API错误代码列表?Facebook图形API错误代码列表

我一直在使用Graph API半年,在过去的6个月里,错误代码的格式已经改变了两次!

我第一次看到的错误代码,它看起来像:

{ 
    "error": { 
     "message": "Error invalidating access token: The session has been invalidated because the user has changed the password.",  
     "type": "OAuthException",  
    } 
} 

这真的很陌生,该错误信息没有提供任何错误代码!

然后几个月后,引入了“预期的”错误代码。

{ 
    "error": { 
     "message": "Error invalidating access token: The session has been invalidated because the user has changed the password.",  
     "type": "OAuthException",  
     "code": 190,  
    } 
} 

但不幸的是,你仍然不能分清哪些错误究竟是通过检查“代码”,因为具有相同的“类型”具有相同的“码”许多错误。

刚才,我发现了错误信息中包含的新领域:

{ 
    "error": { 
     "message": "Error invalidating access token: The session has been invalidated because the user has changed the password.",  
     "type": "OAuthException",  
     "code": 190,  
     "error_subcode": 460 
    } 
} 

好吧,这正是我需要的。

但我在哪里可以找到错误代码列表? 我知道有FQL错误代码列表,http://fbdevwiki.com/wiki/Error_codes#FQL_Errors,但它似乎过时了,并没有提供任何关于“error_subcode”的消息。

+0

的[Facebook的错误代码列表(可能的复制http://stackoverflow.com/questions/4348018/list错误代码) – Flimzy

回答

23

Facebook开发人员Wiki(非官方)不仅包含FQL错误代码列表,还包含others too它以某种方式更新,但不包含可能的错误代码的完整列表。

没有 任何官方或 更新(我的意思是真正更新)由Graph API返回的错误代码列表。每一个可以在网上找到的名单已经过时,并没有太大的帮助...

有官方列表,描述API Errors和基本恢复策略的一些。 也有特定的代码夫妇offcial列表:

+0

OAuth错误链接不再有效。正确的URL在下面的另一个答案中,https://developers.facebook.com/docs/reference/api/errors/ – Jaffer

0

尽管似乎没有一个公开的Facebook可用错误代码列表,但许多人已经自行发布了已知代码的列表。

查看StackOverflow #4348018 - List of Facebook error codes了解大量有用资源。

+0

实际上,大多数您提到的问题的答案也包含完全相同的错误代码列表,它出现在http:// fbdevwiki.com/wiki/Error_codes中,但更为过时... –

4

我也发现了一些更多的错误子码,在OAuth的异常情况。从Facebook的错误追踪复制,没有任何garantee(也许包含过时,错误和停产的):

/** 
    * (Date: 30.01.2013) 
    * 
    * case 1: - "An error occured while creating the share (publishing to wall)" 
    *   - "An unknown error has occurred." 
    * case 2: "An unexpected error has occurred. Please retry your request later." 
    * case 3: App must be on whitelist   
    * case 4: Application request limit reached 
    * case 5: Unauthorized source IP address   
    * case 200: Requires extended permissions 
    * case 240: Requires a valid user is specified (either via the session or via the API parameter for specifying the user." 
    * case 1500: The url you supplied is invalid 
    * case 200: 
    * case 210: - Subject must be a page 
    *   - User not visible 
    */ 

/** 
    * Error Code 100 several issus: 
    * - "Specifying multiple ids with a post method is not supported" (http status 400) 
    * - "Error finding the requested story" but it is available via GET 
    * - "Invalid post_id" 
    * - "Code was invalid or expired. Session is invalid." 
    * 
    * Error Code 2: 
    * - Service temporarily unavailable 
    */ 
+0

嗨,你究竟在哪里找到那个列表? –

+0

我没有找到列表。在阅读了许多错误后,我写下了每个例外情况。我找到的号码。所以没有保证,因为过去也出现了变化。我放弃了太旧的错误报告。 –