Skip to content

Commit

Permalink
chore: Add detailed error message for specific exceptions (#9746)
Browse files Browse the repository at this point in the history
chore: add detailed error message for specific exceptions
  • Loading branch information
filzrev authored Mar 20, 2024
1 parent b130063 commit c3e8352
Showing 1 changed file with 5 additions and 1 deletion.
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}",
code: ErrorCodes.Build.InvalidInputFile);
}
return (null, false);
Expand Down

0 comments on commit c3e8352

Please sign in to comment.