API Reference
ExceptionView
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 24 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 12
- Extension method ExceptionView.WithBasePath
- Extension method ExceptionView.WithMaxFrames
- Extension method ExceptionView.WithMaxInner
- Extension method ExceptionView.WithShowFrameworkFrames
- Extension method ExceptionView.WithShowSource
- Extension method ExceptionView.WithShowStack
- Method ExceptionViewFluent.WithBasePath
- Method ExceptionViewFluent.WithMaxFrames
- Method ExceptionViewFluent.WithMaxInner
- Method ExceptionViewFluent.WithShowFrameworkFrames
- Method ExceptionViewFluent.WithShowSource
- Method ExceptionViewFluent.WithShowStack
Accepted by parameters 12
- Extension method ExceptionView.WithBasePath
- Extension method ExceptionView.WithMaxFrames
- Extension method ExceptionView.WithMaxInner
- Extension method ExceptionView.WithShowFrameworkFrames
- Extension method ExceptionView.WithShowSource
- Extension method ExceptionView.WithShowStack
- Method ExceptionViewFluent.WithBasePath
- Method ExceptionViewFluent.WithMaxFrames
- Method ExceptionViewFluent.WithMaxInner
- Method ExceptionViewFluent.WithShowFrameworkFrames
- Method ExceptionViewFluent.WithShowSource
- Method ExceptionViewFluent.WithShowStack
Constructors
Methods
public List<StyledLine> Lines(Int32 width, RenderContext context) #List<StyledLine>The lines of the view at a width.
Parameters
- width System.Int32
- The width.
- context ConsoleMonster.Canvas.RenderContext
- The render context.
Returns
The lines.
public Size Measure(Constraints constraints, RenderContext context) #SizeReturns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Returns
The desired size, never larger than the constraints.
public Void Render(Region region, RenderContext context) #VoidRenders 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) #String"Namespace.Type.Method(args)" as "Type.Method(args)"; script frames are left as they are.
Parameters
- method System.String
- The method.
Returns
The short form.
public String ShortPath(String path) #StringA path relative to ExceptionView.BasePath when under it, otherwise the folder and file name.
Parameters
- path System.String
- The path.
Returns
The short path.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public Boolean ShowFrameworkFrames { get; set; } #Shows framework frames instead of collapsing them.
public Int32 MaxFrames { get; set; } #The most app frames shown per error (default 8); the rest are counted.
public Boolean ShowStack { get; set; } #Shows the stack frames (default true); off shows the type, message and position only.
public Int32 MaxInner { get; set; } #How many inner errors are shown (default 4).
public Boolean 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 WithBasePath(ExceptionView exceptionView, String? value) #ExceptionViewSets ExceptionView.BasePath: The folder paths are shown relative to (default the current directory).
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value System.String?
- The value.
Returns
The same instance.
public static ExceptionView WithMaxFrames(ExceptionView exceptionView, Int32 value) #ExceptionViewSets ExceptionView.MaxFrames: The most app frames shown per error (default 8); the rest are counted.
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static ExceptionView WithMaxInner(ExceptionView exceptionView, Int32 value) #ExceptionViewSets ExceptionView.MaxInner: How many inner errors are shown (default 4).
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value System.Int32
- The value.
Returns
The same instance.
public static ExceptionView WithShowFrameworkFrames(ExceptionView exceptionView, Boolean value = true) #ExceptionViewSets ExceptionView.ShowFrameworkFrames: Shows framework frames instead of collapsing them.
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.
public static ExceptionView WithShowSource(ExceptionView exceptionView, Boolean value = true) #ExceptionViewSets 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 System.Boolean = true
- The value (default true).
Returns
The same instance.
public static ExceptionView WithShowStack(ExceptionView exceptionView, Boolean value = true) #ExceptionViewSets ExceptionView.ShowStack: Shows the stack frames (default true); off shows the type, message and position only.
Parameters
- exceptionView ConsoleMonster.Widgets.ExceptionView
- The instance.
- value System.Boolean = true
- The value (default true).
Returns
The same instance.