From 6e965cbebca91faa99def2180dcfc4754d40ab5f Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Thu, 29 Feb 2024 10:27:45 +0900 Subject: [PATCH] chore: add detailed error message for specific exceptions --- src/Docfx.Build/HostServiceCreator.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Docfx.Build/HostServiceCreator.cs b/src/Docfx.Build/HostServiceCreator.cs index fb6aea1c646..462b5813afc 100644 --- a/src/Docfx.Build/HostServiceCreator.cs +++ b/src/Docfx.Build/HostServiceCreator.cs @@ -63,8 +63,12 @@ public virtual (FileModel model, bool valid) Load( { if (e is not DocumentException) { + var message = e is ArgumentException or NullReferenceException + ? e.ToString() + : e.Message; + Logger.LogError( - $"Unable to load file '{file.File}' via processor '{processor.Name}': {e.Message}", + $"Unable to load file '{file.File}' via processor '{processor.Name}': {message}", code: ErrorCodes.Build.InvalidInputFile); } return (null, false);