more fatal error cleanups

This commit is contained in:
13xforever
2025-08-23 16:20:24 +05:00
parent 2a77ca9ee3
commit b6cb5ddbea

View File

@@ -652,9 +652,11 @@ internal static partial class LogParserResult
win32ErrorCodes.Add(hexCode);
}
var trimIdx = fatalError.IndexOf(" Called from");
if (trimIdx is -1)
trimIdx = fatalError.IndexOf("(in file");
var errorTxt = fatalError;
if (trimIdx > -1)
errorTxt = fatalError[..trimIdx];
errorTxt = fatalError[..trimIdx].TrimEnd();
errorTxt = errorTxt.Trim(EmbedPager.MaxFieldLength - 7);
builder.AddField(sectionName, $"```\n{errorTxt}```");
}