diff --git a/Tapeti.Transient/TransientRouter.cs b/Tapeti.Transient/TransientRouter.cs index c6a79d6..2aeea29 100644 --- a/Tapeti.Transient/TransientRouter.cs +++ b/Tapeti.Transient/TransientRouter.cs @@ -42,7 +42,7 @@ namespace Tapeti.Transient return; if (map.TryRemove(continuationID, out var tcs)) - tcs.SetResult(context.Message); + tcs.TrySetResult(context.Message); } @@ -86,7 +86,7 @@ namespace Tapeti.Transient private void TimeoutResponse(object tcs) { - ((TaskCompletionSource)tcs).SetException(new TimeoutException("Transient RequestResponse timed out at (ms) " + defaultTimeoutMs)); + ((TaskCompletionSource)tcs).TrySetException(new TimeoutException("Transient RequestResponse timed out at (ms) " + defaultTimeoutMs)); } } } \ No newline at end of file