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
14 changes: 13 additions & 1 deletion Packages/com.trytalo.talo/Runtime/Utils/ContinuityManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public async void ProcessRequests()
if (!HasRequests() || !await Talo.HealthCheck.Ping()) return;

var queue = new List<Request>(_requests.Take(10));
var exceptions = new List<Exception>();

for (var i = 0; i < queue.Count; i++)
{
Expand All @@ -98,7 +99,18 @@ public async void ProcessRequests()
headers.Add(new HttpHeader("X-Talo-Continuity-Timestamp", request.timestamp.ToString()));
}

await _api.Replay(uri, request.method, request.content, headers);
try
{
await _api.Replay(uri, request.method, request.content, headers);
} catch (Exception e)
{
exceptions.Add(e);
}
}

if (exceptions.Count > 0)
{
throw new ContinuityReplayException(exceptions);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;

namespace TaloGameServices
{
public class ContinuityReplayException : Exception
{
private List<Exception> _exceptions;
public List<Exception> Exceptions => _exceptions;

public ContinuityReplayException(List<Exception> exceptions)
: base($"{exceptions.Count} requests failed after being replayed")
{
_exceptions = exceptions;
}

public ContinuityReplayException(List<Exception> exceptions, Exception inner)
: base($"{exceptions.Count} requests failed after being replayed", inner)
{
_exceptions = exceptions;
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.