private FacebookApiEventArgs GetApiEventArgs(AsyncCompletedEventArgs e, string json, out HttpMethod httpMethod)
{
var state = (WebClientStateContainer)e.UserState;
httpMethod = state.Method;
var cancelled = e.Cancelled;
var userState = state.UserState;
var error = e.Error;
// Check for Graph Exception
var webException = error as WebExceptionWrapper;
if (webException != null)
{
error = ExceptionFactory.GetGraphException(webException);
}
if (error == null)
{
error = ExceptionFactory.CheckForRestException(DomainMaps, state.RequestUri, json) ?? error;
}
var args = new FacebookApiEventArgs(error, cancelled, userState, json);
return args;
}