新增 ,定时器自定义异常类
This commit is contained in:
@@ -25,7 +25,7 @@ namespace Tnb.Common.Extension
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
public static async Task Catch(this Task task, Action<Exception> exceptionHandler)
|
||||
public static async Task Catch(this Task task, Func<Exception,Task> exceptionHandler)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -33,7 +33,7 @@ namespace Tnb.Common.Extension
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
exceptionHandler(ex);
|
||||
await exceptionHandler(ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user