Reputation: 4419
Where can I find the official Graph API Error Code list?
I have been using the Graph API for half a year, and in the past 6 months, the error code's format has changed twice!
The first time I saw the error code, it looks like:
{
"error": {
"message": "Error invalidating access token: The session has been invalidated because the user has changed the password.",
"type": "OAuthException",
}
}
It's really stranger, the error message didn't provide any error code!
And then several months later, the "expected" error code was introduced.
{
"error": {
"message": "Error invalidating access token: The session has been invalidated because the user has changed the password.",
"type": "OAuthException",
"code": 190,
}
}
But sadly, you still cannot distinguish what the error exactly is by checking the "code", since many errors with the same "type" have the same "code".
Just now, I found the error message contains new field:
{
"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
}
}
OK, it's just what I need.
But where can I find the error code list? I knew there is FQL error code list, http://fbdevwiki.com/wiki/Error_codes#FQL_Errors, but it seems out of date and does not provide any message about the "error_subcode".
Upvotes: 34
Views: 113560
Reputation: 25918
Facebook Developer Wiki (unofficial) contain not only list of FQL error codes but others too it's somehow updated but not contain full list of possible error codes.
There is no any official or updated (I mean really updated) list of error codes returned by Graph API. Every list that can be found online is outdated and not help that much...
There is official list describing some of API Errors and basic recovery tactics. Also there is couple of offcial lists for specific codes:
Upvotes: 24
Reputation: 2161
I have also found some more error subcodes, in case of OAuth exception. Copied from the facebook bugtracker, without any garantee (maybe contain deprecated, wrong and discontinued ones):
/**
* (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
*/
Upvotes: 5
Reputation: 5241
I was looking for the same thing and I just found this list
https://developers.facebook.com/docs/reference/api/errors/
Upvotes: 13
Reputation: 13266
While there does not appear to be a public, Facebook-curated list of error codes available, a number of folks have taken it upon themselves to publish lists of known codes.
Take a look at StackOverflow #4348018 - List of Facebook error codes for a number of useful resources.
Upvotes: 0