Esempio n. 1
0
        private void OnErrorDefaultCallback(WWWErrorException ex)
        {
            _isConnectionAvailable = false;

            if (ex.StatusCode == 0)
            {
                Debug.LogError("Error: Unable to connect to server");
                return;
            }

            Debug.LogErrorFormat("Error {0}: {1}", (int)ex.StatusCode, ex.StatusCode);
        }
Esempio n. 2
0
 private void LogWWWError(WWWErrorException ex)
 {
     Debug.Log(ex.RawErrorMessage);
     if (ex.HasResponse)
     {
         Debug.Log(ex.StatusCode);
     }
     foreach (var item in ex.ResponseHeaders)
     {
         Debug.Log(item.Key + ":" + item.Value);
     }
 }
Esempio n. 3
0
 private PlayFabException GetException(WWWErrorException wwwError)
 {
     try
     {
         JSONObject json         = JSONObject.Create(wwwError.WWW.text);
         int        errorCode    = json.asInt("errorCode", () => 0);
         string     errorName    = json.asString("error", () => string.Empty);
         string     errorMessage = json.asString("errorMessage", () => string.Empty);
         return(new PlayFabException(errorCode, errorName, errorMessage));
     }
     catch (Exception)
     {
         return(new PlayFabException(PlayFabError.UNKNOWN, string.Empty, string.Empty));
     }
 }