ExceptionView
ConsoleMonster.Widgets
An exception or PowerShell error, readable: the fail symbol and the type, the message, the PowerShell category, error id and position message, the script stack, the .NET frames as "Type.Method()" with shortened paths and file:line as links, framework frames collapsed into "+n framework frames", and the inner errors as "Caused by".
Inheritance
- object
- ExceptionView
Usage
Explore 32 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 16
- Extension method ExceptionView.BasePath
- Extension method ExceptionView.Compact
- Extension method ExceptionView.DetailsHint
- Extension method ExceptionView.MaxFrames
- Extension method ExceptionView.MaxInner
- Extension method ExceptionView.ShowFrameworkFrames
- Extension method ExceptionView.ShowSource
- Extension method ExceptionView.ShowStack
- Method ExceptionViewFluent.BasePath
- Method ExceptionViewFluent.Compact
- Method ExceptionViewFluent.DetailsHint
- Method ExceptionViewFluent.MaxFrames
- Method ExceptionViewFluent.MaxInner
- Method ExceptionViewFluent.ShowFrameworkFrames
- Method ExceptionViewFluent.ShowSource
- Method ExceptionViewFluent.ShowStack
Accepted by parameters 16
- Extension method ExceptionView.BasePath
- Extension method ExceptionView.Compact
- Extension method ExceptionView.DetailsHint
- Extension method ExceptionView.MaxFrames
- Extension method ExceptionView.MaxInner
- Extension method ExceptionView.ShowFrameworkFrames
- Extension method ExceptionView.ShowSource
- Extension method ExceptionView.ShowStack
- Method ExceptionViewFluent.BasePath
- Method ExceptionViewFluent.Compact
- Method ExceptionViewFluent.DetailsHint
- Method ExceptionViewFluent.MaxFrames
- Method ExceptionViewFluent.MaxInner
- Method ExceptionViewFluent.ShowFrameworkFrames
- Method ExceptionViewFluent.ShowSource
- Method ExceptionViewFluent.ShowStack
Constructors
Methods
public List<StyledLine> Lines(int width, RenderContext context) #The lines of the view at a width.
Parameters
- width int
- The width.
- context ConsoleMonster.Canvas.RenderContext
- The render context.
public Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public void Render(Region region, RenderContext context) #Renders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public static string ShortMethod(string method) #"Namespace.Type.Method(args)" as "Type.Method(args)"; script frames are left as they are.
Parameters
- method string
- The method.
Returns
string The short form.public string ShortPath(string path) #A path relative to ExceptionView.BasePath when under it, otherwise the folder and file name.
Parameters
- path string
- The path.
Returns
string The short path.Inherited Methods
Properties
public bool Compact { get; set; } #Uses a message-first layout with the invocation line and a folded inner-exception count.
public string? DetailsHint { get; set; } #A muted next-step hint, or null for no hint.
public bool ShowFrameworkFrames { get; set; } #Shows framework frames instead of collapsing them.
public int MaxFrames { get; set; } #The most app frames shown per error (default 8); the rest are counted.
public bool ShowStack { get; set; } #Shows the stack frames (default true); off shows the type, message and position only.
public bool ShowSource { get; set; } #Shows the source lines around the first app frame whose file can be read (default true), highlighted.
public string? BasePath { get; set; } #The folder paths are shown relative to (default the current directory).
Extension Methods
public static ExceptionView BasePath(ExceptionView exceptionView, string? value) #Sets ExceptionView.BasePath: The folder paths are shown relative to (default the current directory).
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
exceptionView.BasePath = value; exceptionView.BasePath(value);public static ExceptionView Compact(ExceptionView exceptionView, bool value = true) #Sets ExceptionView.Compact: Uses a message-first layout with the invocation line and a folded inner-exception count.
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
exceptionView.Compact = value; exceptionView.Compact(value);public static ExceptionView DetailsHint(ExceptionView exceptionView, string? value) #Sets ExceptionView.DetailsHint: A muted next-step hint, or null for no hint.
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
exceptionView.DetailsHint = value; exceptionView.DetailsHint(value);public static ExceptionView MaxFrames(ExceptionView exceptionView, int value) #Sets ExceptionView.MaxFrames: The most app frames shown per error (default 8); the rest are counted.
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
exceptionView.MaxFrames = value; exceptionView.MaxFrames(value);public static ExceptionView MaxInner(ExceptionView exceptionView, int value) #Sets ExceptionView.MaxInner: How many inner errors are shown (default 4).
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
exceptionView.MaxInner = value; exceptionView.MaxInner(value);public static ExceptionView ShowFrameworkFrames(ExceptionView exceptionView, bool value = true) #Sets ExceptionView.ShowFrameworkFrames: Shows framework frames instead of collapsing them.
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
exceptionView.ShowFrameworkFrames = value; exceptionView.ShowFrameworkFrames(value);public static ExceptionView ShowSource(ExceptionView exceptionView, bool value = true) #Sets ExceptionView.ShowSource: Shows the source lines around the first app frame whose file can be read (default true), highlighted.
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
exceptionView.ShowSource = value; exceptionView.ShowSource(value);public static ExceptionView ShowStack(ExceptionView exceptionView, bool value = true) #Sets ExceptionView.ShowStack: Shows the stack frames (default true); off shows the type, message and position only.
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
exceptionView.ShowStack = value; exceptionView.ShowStack(value);