Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add detailed error message for specific exceptions #9746

Merged
merged 8 commits into from
Mar 20, 2024
6 changes: 5 additions & 1 deletion src/Docfx.Build/HostServiceCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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}",
yufeih marked this conversation as resolved.
Show resolved Hide resolved
code: ErrorCodes.Build.InvalidInputFile);
}
return (null, false);
Expand Down