From 2e1106d96918890191382e36d46b2cffff0c25b1 Mon Sep 17 00:00:00 2001 From: sai pramod upadhyayula <6154629+saipramod@users.noreply.github.com> Date: Thu, 11 Aug 2022 14:34:38 -0700 Subject: [PATCH 1/2] Add try catch and needed logging --- .../CompilePhaseHandler.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.DocAsCode.Build.Engine/CompilePhaseHandler.cs b/src/Microsoft.DocAsCode.Build.Engine/CompilePhaseHandler.cs index 02793c96fc3..f2b62e2d5da 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/CompilePhaseHandler.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/CompilePhaseHandler.cs @@ -140,7 +140,15 @@ private static void BuildArticle(HostService hostService, int maxParallelism) Logger.LogDiagnostic($"Processor {hostService.Processor.Name}, step {buildStep.Name}: Building..."); using (new LoggerPhaseScope(buildStep.Name, LogLevel.Diagnostic, aggregatedPerformanceScope)) { - buildStep.Build(m, hostService); + try + { + buildStep.Build(m, hostService); + } + catch (Exception ex) + { + Logger.LogError($"Trouble processing file - {m.FileAndType.FullPath}, with error - {ex.Message}"); + throw; + } } }); } From 5dc798585903e9636c4ce0e7536c0cb1646b8479 Mon Sep 17 00:00:00 2001 From: Sai Pramod Upadhyayula Date: Mon, 15 Aug 2022 07:37:21 -0700 Subject: [PATCH 2/2] missing import --- src/Microsoft.DocAsCode.Build.Engine/CompilePhaseHandler.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Microsoft.DocAsCode.Build.Engine/CompilePhaseHandler.cs b/src/Microsoft.DocAsCode.Build.Engine/CompilePhaseHandler.cs index f2b62e2d5da..4e5f6b8d8be 100644 --- a/src/Microsoft.DocAsCode.Build.Engine/CompilePhaseHandler.cs +++ b/src/Microsoft.DocAsCode.Build.Engine/CompilePhaseHandler.cs @@ -3,6 +3,7 @@ namespace Microsoft.DocAsCode.Build.Engine { + using System; using System.Collections.Generic; using System.Collections.Immutable; using System.IO;