Skip to content

Commit b0daa74

Browse files
Add additional error handling when UnityWebRequest fails
1 parent a1d3c8d commit b0daa74

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Runtime/Client/LootLockerBaseServerAPI.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ IEnumerator coroutine()
9898

9999
try
100100
{
101+
if (webRequest.error != null)
102+
{
103+
LootLockerSDKManager.DebugMessage($"Server request failed: {webRequest.error}");
104+
yield break;
105+
}
106+
101107
LootLockerSDKManager.DebugMessage("Server Response: " + request.httpMethod + " " + request.endpoint + " completed in " + (Time.time - startTime).ToString("n4") + " secs.\nResponse: " + webRequest.downloadHandler.text);
102108
}
103109
catch

0 commit comments

Comments
 (0)