Added NoStackTrace to ExceptionFormats (#1489)

This commit is contained in:
Gerardo Grignoli
2024-03-08 12:26:45 -03:00
committed by GitHub
parent d921ac6f02
commit e66d3aab2e
4 changed files with 27 additions and 0 deletions

View File

@ -35,4 +35,9 @@ public enum ExceptionFormats
/// Shortens everything that can be shortened.
/// </summary>
ShortenEverything = ShortenMethods | ShortenTypes | ShortenPaths,
/// <summary>
/// Whether or not to show the exception stack trace.
/// </summary>
NoStackTrace = 16,
}

View File

@ -50,6 +50,11 @@ internal static class ExceptionFormatter
}
// Stack frames
if ((settings.Format & ExceptionFormats.NoStackTrace) != 0)
{
return grid;
}
var stackTrace = new StackTrace(ex, fNeedFileInfo: true);
var frames = stackTrace
.GetFrames()