mirror of https://github.com/Cysharp/UniTask
Improve UnityWebRequestError performance
parent
5ed943bca2
commit
c2538da1cd
|
@ -10,13 +10,30 @@ namespace Cysharp.Threading.Tasks
|
|||
public UnityWebRequest UnityWebRequest { get; }
|
||||
public bool IsNetworkError { get; }
|
||||
public bool IsHttpError { get; }
|
||||
public string Error { get; }
|
||||
public string Text { get; }
|
||||
|
||||
string msg;
|
||||
|
||||
public UnityWebRequestException(UnityWebRequest unityWebRequest)
|
||||
: base(unityWebRequest.error + Environment.NewLine + unityWebRequest.downloadHandler.text)
|
||||
{
|
||||
this.UnityWebRequest = unityWebRequest;
|
||||
this.IsNetworkError = unityWebRequest.isNetworkError;
|
||||
this.IsHttpError = unityWebRequest.isHttpError;
|
||||
this.Error = unityWebRequest.error;
|
||||
this.Text = unityWebRequest.downloadHandler.text;
|
||||
}
|
||||
|
||||
public override string Message
|
||||
{
|
||||
get
|
||||
{
|
||||
if (msg == null)
|
||||
{
|
||||
msg = Error + Environment.NewLine + Text;
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue