在哪里可以找到官方 Graph 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”的任何消息。
最佳答案
Facebook Developer Wiki(非官方)不仅包含 FQL 错误代码列表,还包含 others too它以某种方式更新但不包含可能的错误代码的完整列表。
Graph API 返回的错误代码列表没有任何官方或更新(我的意思是真的更新)。可以在网上找到的每个列表都已过时并且没有太大帮助...
官方列表描述了一些API Errors和基本的恢复策略。 还有一些特定代码的官方列表:
关于Facebook Graph API 错误代码列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10478812/