Skip to content

Commit 298d510

Browse files
authored
Merge pull request #386 from rabbitmq/rabbitmq-stream-dotnet-client-385-followup
Follow-up to #385
2 parents 14b6e2d + c006ff4 commit 298d510

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

RabbitMQ.Stream.Client/Client.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,11 +976,13 @@ public bool RunContinuationsAsynchronously
976976
public void SetException(Exception error)
977977
{
978978
// https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/issues/384
979-
// we need to check if the task is pending before setting the exception
980-
if (_logic.GetStatus(_logic.Version) == ValueTaskSourceStatus.Pending)
979+
try
981980
{
982981
_logic.SetException(error);
983982
}
983+
catch (InvalidOperationException)
984+
{
985+
}
984986
}
985987

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

0 commit comments

Comments
 (0)