added exception logging to Tasks.

This commit is contained in:
kay.one 2013-07-11 23:10:34 -07:00
parent 508b087c46
commit d607b831c9
7 changed files with 39 additions and 6 deletions

View file

@ -4,6 +4,7 @@ using System.Threading.Tasks;
using NLog;
using NzbDrone.Common.EnsureThat;
using NzbDrone.Common.Serializer;
using NzbDrone.Common.TPL;
namespace NzbDrone.Common.Messaging
{
@ -53,7 +54,8 @@ namespace NzbDrone.Common.Messaging
_logger.Debug("{0} ~> {1}", eventName, handlerLocal.GetType().Name);
handlerLocal.HandleAsync(@event);
_logger.Debug("{0} <~ {1}", eventName, handlerLocal.GetType().Name);
}, TaskCreationOptions.PreferFairness);
}, TaskCreationOptions.PreferFairness)
.LogExceptions();
}
}