mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 18:40:50 +08:00 
			
		
		
		
	Added NoStackTrace to ExceptionFormats (#1489)
This commit is contained in:
		@@ -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,
 | 
			
		||||
}
 | 
			
		||||
@@ -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()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user