Skip to content

Commit

Permalink
Merge pull request #386 from rabbitmq/rabbitmq-stream-dotnet-client-3…
Browse files Browse the repository at this point in the history
…85-followup

Follow-up to #385
  • Loading branch information
lukebakken authored Jun 10, 2024
2 parents 14b6e2d + c006ff4 commit 298d510
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions RabbitMQ.Stream.Client/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -976,11 +976,13 @@ public bool RunContinuationsAsynchronously
public void SetException(Exception error)
{
// https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/issues/384
// we need to check if the task is pending before setting the exception
if (_logic.GetStatus(_logic.Version) == ValueTaskSourceStatus.Pending)
try
{
_logic.SetException(error);
}
catch (InvalidOperationException)
{
}
}

void IValueTaskSource.GetResult(short token) => _logic.GetResult(token);
Expand Down

0 comments on commit 298d510

Please sign in to comment.