We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c395ca4 commit aa5e8cbCopy full SHA for aa5e8cb
projects/RabbitMQ.Client/client/impl/Work.cs
@@ -1,4 +1,5 @@
1
-using System.Threading.Tasks;
+using System;
2
+using System.Threading.Tasks;
3
4
namespace RabbitMQ.Client.Impl
5
{
@@ -11,9 +12,17 @@ protected Work(IBasicConsumer consumer)
11
12
_asyncConsumer = (IAsyncBasicConsumer)consumer;
13
}
14
- public Task Execute(ModelBase model)
15
+ public async Task Execute(ModelBase model)
16
- return Execute(model, _asyncConsumer);
17
+ try
18
+ {
19
+ await Task.Yield();
20
+ await Execute(model, _asyncConsumer).ConfigureAwait(false);
21
+ }
22
+ catch (Exception)
23
24
+ // intentionally caught
25
26
27
28
protected abstract Task Execute(ModelBase model, IAsyncBasicConsumer consumer);
0 commit comments