diff --git a/AsbCloudInfrastructure/Services/ReportService.cs b/AsbCloudInfrastructure/Services/ReportService.cs index a4f659f8..e4094c34 100644 --- a/AsbCloudInfrastructure/Services/ReportService.cs +++ b/AsbCloudInfrastructure/Services/ReportService.cs @@ -98,6 +98,17 @@ namespace AsbCloudInfrastructure.Services }; var work = Work.CreateByDelegate(workId, workAction); + work.OnErrorAsync = (message, exception, token) => Task.Run(() => progressHandler.Invoke(new + { + Operation = "error", + Progress = 100f, + Message = string.IsNullOrEmpty(message) + ? exception.Message + : message, + Exception = exception, + }, workId) + , token); + backgroundWorkerService.Enqueue(work); progressHandler.Invoke(new ReportProgressDto