diff --git a/src/DotNetCore.CAP/Processor/IDispatcher.Default.cs b/src/DotNetCore.CAP/Processor/IDispatcher.Default.cs index d2f21cc..3195169 100644 --- a/src/DotNetCore.CAP/Processor/IDispatcher.Default.cs +++ b/src/DotNetCore.CAP/Processor/IDispatcher.Default.cs @@ -98,7 +98,15 @@ namespace DotNetCore.CAP.Processor { while (_receivedChannel.Reader.TryRead(out var message)) { - await _executor.DispatchAsync(message.Item1, message.Item2, _cts.Token); + try + { + await _executor.DispatchAsync(message.Item1, message.Item2, _cts.Token); + } + catch (Exception e) + { + _logger.LogError(e, + $"An exception occurred when invoke subscriber. MessageId:{message.Item1.DbId}"); + } } } }