Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Assets/Talo Game Services/Talo/Runtime/APIs/EventsAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ public async Task Flush()
eventsToFlush.Clear();
lockFlushes = false;
}
catch (Exception err)
catch (Exception ex)
{
Debug.LogError(err.Message);
Debug.LogError(ex.Message);
}

if (flushAttemptedDuringLock)
Expand Down
8 changes: 4 additions & 4 deletions Assets/Talo Game Services/Talo/Runtime/APIs/PlayersAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@ private void DeleteOfflineAlias()
{
File.Delete(offlineDataPath);
}
catch (Exception e)
catch (Exception ex)
{
Debug.LogWarning($"Failed to delete offline player data: {e.Message}");
Debug.LogWarning($"Failed to delete offline player data: {ex.Message}");
}
}
}
Expand All @@ -172,9 +172,9 @@ public async Task ClearIdentity()
{
DeleteOfflineAlias();
}
catch (Exception e)
catch (Exception ex)
{
Debug.LogWarning($"Error deleting offline alias: {e.Message}");
Debug.LogWarning($"Error deleting offline alias: {ex.Message}");
}

try
Expand Down
12 changes: 6 additions & 6 deletions Assets/Talo Game Services/Talo/Runtime/Entities/LiveConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public void WriteOfflineConfig()
var json = JsonUtility.ToJson(new GameConfigResponse { config = props });
Talo.Crypto.WriteFileContent(offlineDataPath, json);
}
catch (Exception e)
catch (Exception ex)
{
Debug.LogWarning($"Failed to write offline config: {e.Message}");
Debug.LogWarning($"Failed to write offline config: {ex.Message}");
}
}

Expand All @@ -54,9 +54,9 @@ public static LiveConfig GetOfflineConfig()
var response = JsonUtility.FromJson<GameConfigResponse>(json);
return new LiveConfig(response.config);
}
catch (Exception e)
catch (Exception ex)
{
Debug.LogWarning($"Failed to read offline config: {e.Message}");
Debug.LogWarning($"Failed to read offline config: {ex.Message}");
return null;
}
}
Expand All @@ -73,9 +73,9 @@ public static long GetOfflineConfigLastModified()
var fileInfo = new FileInfo(offlineDataPath);
return new DateTimeOffset(fileInfo.LastWriteTimeUtc).ToUnixTimeSeconds();
}
catch (Exception e)
catch (Exception ex)
{
Debug.LogWarning($"Failed to get offline config last modified time: {e.Message}");
Debug.LogWarning($"Failed to get offline config last modified time: {ex.Message}");
return 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ public async void ProcessRequests()
try
{
await _api.Replay(uri, request.method, request.content, headers);
} catch (Exception e)
} catch (Exception ex)
{
exceptions.Add(e);
exceptions.Add(ex);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ private async void OnLoginClick()
SendMessageUpwards("GoToVerify", SendMessageOptions.RequireReceiver);
}
}
catch (PlayerAuthException e)
catch (PlayerAuthException ex)
{
validationLabel.text = e.ErrorCode switch
validationLabel.text = ex.ErrorCode switch
{
PlayerAuthErrorCode.INVALID_CREDENTIALS => "Username or password is incorrect",
_ => e.Message
_ => ex.Message
};
}
catch (Exception e)
catch (Exception ex)
{
validationLabel.text = e.Message;
validationLabel.text = ex.Message;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,18 @@ private async void OnRegisterClick()
{
await Talo.PlayerAuth.Register(username, password, email, enableVerification);
}
catch (PlayerAuthException e)
catch (PlayerAuthException ex)
{
validationLabel.text = e.ErrorCode switch
validationLabel.text = ex.ErrorCode switch
{
PlayerAuthErrorCode.IDENTIFIER_TAKEN => "Username is already taken",
PlayerAuthErrorCode.INVALID_EMAIL => "Invalid email address",
_ => e.Message
_ => ex.Message
};
}
catch (Exception e)
catch (Exception ex)
{
validationLabel.text = e.Message;
validationLabel.text = ex.Message;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ private async void OnSubmitClicked()
{
await Talo.PlayerAuth.Verify(code);
}
catch (PlayerAuthException e)
catch (PlayerAuthException ex)
{
validationLabel.text = e.ErrorCode switch
validationLabel.text = ex.ErrorCode switch
{
PlayerAuthErrorCode.VERIFICATION_CODE_INVALID => "Verification code is incorrect",
_ => e.Message
_ => ex.Message
};
}
catch (Exception e)
catch (Exception ex)
{
validationLabel.text = e.Message;
validationLabel.text = ex.Message;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ private async Task Flush()

ResponseMessage.SetText("Flushed events");
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ private async Task Track()
ResponseMessage.SetText($"{eventName} tracked and events flushed");
}
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public async void OnButtonClick()
await Talo.Feedback.Send(categoryInternalName, feedbackComment);
ResponseMessage.SetText($"Feedback sent for {categoryInternalName}: {feedbackComment}");
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ private async Task FetchEntries()
ResponseMessage.SetText(string.Join(", ", entries.Select((e) => e.ToString()).ToArray()));
}
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ private async Task PostEntry()

ResponseMessage.SetText($"Entry with score {score} added, position is {entry.position}, it was {(updated ? "" : "not")} updated");
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ private async Task DeleteProp()
await Talo.CurrentPlayer.DeleteProp(key);
ResponseMessage.SetText($"{key} deleted");
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public async void OnButtonClick()
var res = await Talo.PlayerGroups.Get(groupId);
ResponseMessage.SetText($"{res.group.name} has {res.group.count} player(s)");
}
catch (Exception e)
catch (Exception ex)
{
ResponseMessage.SetText(e.Message);
ResponseMessage.SetText(ex.Message);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ private async Task Identify()
{
await Talo.Players.Identify(service, identifier);
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ private async Task UpdateProp()
await Talo.CurrentPlayer.SetProp(key, value);
ResponseMessage.SetText($"{key} set to {value}");
}
catch (System.Exception err)
catch (System.Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ private async void FetchStats()
var internalNames = res.Length > 0 ? string.Join(", ", res.Select((item) => item.internalName)) : "no stats";
ResponseMessage.SetText($"Stats: {internalNames}");
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ private async void FetchGlobalHistory()
$"average player value: {playerMetrics.averageValue}"
);
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ private async void FetchPlayerStat()
var res = await Talo.Stats.FindPlayerStat(statInternalName);
ResponseMessage.SetText($"{statInternalName} value: {(res == null ? "not set" : res.value)}, last updated: {res?.updatedAt ?? "never"}");
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ private async void FetchStat()
var res = await Talo.Stats.Find(statInternalName);
ResponseMessage.SetText($"{res.name} is{(res.global ? "" : " not")} a global stat, with a default value of {res.defaultValue}");
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ private async void FetchHistory()

ResponseMessage.SetText($"{statInternalName} changed by: {changeString}");
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ private async void Track()

ResponseMessage.SetText($"{statInternalName} changed by {change}, new value is {res.playerStat.value}");
}
catch (Exception err)
catch (Exception ex)
{
ResponseMessage.SetText(err.Message);
throw err;
ResponseMessage.SetText(ex.Message);
throw;
}
}
}
Expand Down