Skip to content
Merged
Changes from 1 commit
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
22 changes: 20 additions & 2 deletions projects/RabbitMQ.Client/client/impl/AsyncConsumerWorkService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,16 @@ private async Task Loop()
try
{
Task task = work.Execute();
await task.ConfigureAwait(false);
if (!task.IsCompleted)
{
await task.ConfigureAwait(false);
}

// Without await, the exception will disappear
if(task.Exception != null)
{
throw task.Exception.InnerException;
}
}
catch (Exception e)
{
Expand Down Expand Up @@ -143,7 +152,16 @@ private static async Task HandleConcurrent(Work work, IModel model, SemaphoreSli
try
{
Task task = work.Execute();
await task.ConfigureAwait(false);
if (!task.IsCompleted)
{
await task.ConfigureAwait(false);
}

// Without await, the exception will disappear
if (task.Exception != null)
{
throw task.Exception.InnerException;
}
}
catch (Exception e)
{
Expand Down