Task.Factory.StartNew(() =>
{
//业务逻辑
}).ContinueWith(task =>
{
if (task.IsCompleted && !task.IsFaulted)
{
//没有出现异常
}
else
{
//出现异常
var exection = task.Exception;
Log(exection);
}
});
标签:IsCompleted,异步,Task,IsFaulted,捕获,task,出现异常,exection
来源: https://www.cnblogs.com/jeffhong99/p/11765851.html