Eva*_* Y. 34 facebook facebook-graph-api
我在哪里可以找到官方的图谱API错误代码列表?
我已经使用Graph API半年了,在过去的6个月里,错误代码的格式已经改变了两次!
我第一次看到错误代码,它看起来像:
{
"error": {
"message": "Error invalidating access token: The session has been invalidated because the user has changed the password.",
"type": "OAuthException",
}
}
Run Code Online (Sandbox Code Playgroud)
这真的很奇怪,错误消息没有提供任何错误代码!
然后几个月后,引入了"预期的"错误代码.
{
"error": {
"message": "Error invalidating access token: The session has been invalidated because the user has changed the password.",
"type": "OAuthException",
"code": 190,
}
}
Run Code Online (Sandbox Code Playgroud)
但遗憾的是,你仍然无法通过检查"代码"来区分错误是什么,因为许多具有相同"类型"的错误具有相同的"代码".
刚才,我发现错误信息包含新字段:
{
"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
}
}
Run Code Online (Sandbox Code Playgroud)
好的,这正是我需要的.
但是我在哪里可以找到错误代码列表?我知道有FQL错误代码列表,http: //fbdevwiki.com/wiki/Error_codes#FQL_Errors,但它似乎已过时,并未提供有关"error_subcode"的任何消息.
如果发生OAuth异常,我还发现了更多错误子代码。从facebook bugtracker复制而来,没有任何担保(可能包含已弃用,错误和已停产的内容):
/**
* (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
*/
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
103619 次 |
| 最近记录: |