0
在我的应用程序中,我希望在发生FacebookOauthException时记录所有错误消息及其错误代码,但我无法找到解决方法。 根据Facebook的异常对象包含获取FacebookOauthException的错误代码
{
"error": {
"message": "Error validating access token: Session has expired at unix
time SOME_TIME. The current unix time is SOME_TIME.",
"type": "OAuthException",
"code": 190
"error_subcode": 463
}
,并在C#中,我试图捕捉例外下列方式:
try
{
FacebookWebClient facebookWebClient = new FacebookWebClient(pAccessToken);
JsonObject facebookPagesJsonObj = facebookWebClient.Get(@"\me\accounts") as JsonObject;
JsonArray faceookPagesJsonArray = facebookPagesJsonObj["data"] as JsonArray;
}
catch (FacebookApiException facebookException)
{
if (facebookException.ErrorType.ToLower().Equals("oauthexception"))
{
//want to access error code,error message and error_subcode here.
}
}
这将是巨大的,如果有人能帮助我。
谢谢,
普里亚