ExceptionOptions class

Options for configuring Kestrun-style exception handling middleware.

public sealed class ExceptionOptions : ExceptionHandlerOptions

Public Members

name description
ExceptionOptions(…) Initializes a new instance of the ExceptionOptions class.
DeveloperExceptionPageOptions { get; set; } Optional Developer Exception Page options. If present, the Developer Exception Page middleware is used.
Host { get; set; } Host is needed for runspace/bootstrap if using PowerShell.
LanguageOptions { get; set; } Optional scripting options (e.g., PowerShell). If present, a script-based handler is used.
LegacyStatusCodeSelector { get; set; } .NET 8: Optional custom status code selector for JSON/script fallback. Lets you map exception types to status codes.
UseJsonExceptionHandler(…) Builds a JSON fallback handler that can be used if no script/inline handler is provided.

See Also