CheckForRestException() static private method

Checks for rest exception.
static private CheckForRestException ( Uri>.IDictionary domainMaps, Uri requestUri, object json ) : FacebookApiException
domainMaps Uri>.IDictionary /// The domain maps. ///
requestUri System.Uri /// The request uri. ///
json object /// The json string. ///
return FacebookApiException
        internal protected virtual object Api(string path, IDictionary <string, object> parameters, HttpMethod httpMethod, Type resultType)
        {
            var mergedParameters = FacebookUtils.Merge(null, parameters);

            if (!mergedParameters.ContainsKey("access_token") && !string.IsNullOrEmpty(AccessToken))
            {
                mergedParameters["access_token"] = AccessToken;
            }

            Uri    requestUrl;
            string contentType;

            byte[] postData = BuildRequestData(path, mergedParameters, httpMethod, out requestUrl, out contentType);

            var jsonString = MakeRequest(httpMethod, requestUrl, postData, contentType);

            var json = JsonSerializer.Current.DeserializeObject(jsonString);

            FacebookApiException facebookApiException =
                ExceptionFactory.GetGraphException(json) ??
                ExceptionFactory.CheckForRestException(DomainMaps, requestUrl, json);

            if (facebookApiException != null)
            {
                throw facebookApiException;
            }

            return(resultType == null ? json : JsonSerializer.Current.DeserializeObject(jsonString, resultType));
        }
        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) ?? (Exception)webException.ActualWebException;
            }

            if (error == null)
            {
                var jsonObj = JsonSerializer.Current.DeserializeObject(json);

                // we need to check for graph exception here again coz fb return 200ok
                // for https://graph.facebook.com/i_dont_exist
                error = ExceptionFactory.GetGraphException(jsonObj) ??
                        ExceptionFactory.CheckForRestException(DomainMaps, state.RequestUri, jsonObj);
            }

            var args = new FacebookApiEventArgs(error, cancelled, userState, json, state.IsBatchRequest);

            return(args);
        }