Quantcast
Channel: Questions in topic: "assetbundles"
Viewing all articles
Browse latest Browse all 312

UnityWebRequest returns different errors for right urls

$
0
0
I'm using UnityWebRequest to download asset bundles from my server. Sometimes the following code returns different exceptions such as Failed to receive data , Cannot resolve destination host, Cannot connect to destination host, Unknown Error, Request timeout and so on. Here is the part of my code. UnityWebRequest www = UnityWebRequestAssetBundle.GetAssetBundle(url,(uint)data.version,0); Debug.Log ("Downloading " + url); yield return www.SendWebRequest(); AssetBundle bundle = null; if(www.isNetworkError || www.isHttpError) { Debug.Log(www.isNetworkError); Debug.Log(www.isHttpError); Debug.Log(www.error); if (ARSceneManager.Instance != null) data.downloadAssetBundlesCompleted?.Invoke(null); } else { bundle = DownloadHandlerAssetBundle.GetContent(www); } if (!string.IsNullOrEmpty(www.error)) { throw new Exception("WWW download: " + url + ", " + www.error); } So I get the errors for different urls and in some cases. P.S. the same URL works for the next time, also it works in browser too. So I don't think there are issues with urls. Thanks.

Viewing all articles
Browse latest Browse all 312

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>