新增 ,定时器自定义异常类

This commit is contained in:
alex
2023-08-09 14:20:50 +08:00
parent 3d66e60477
commit e4cbbe4bfb
4 changed files with 78 additions and 7 deletions

View File

@@ -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);
}
}