Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IExceptionHandler Interface

Definition

Namespace:
Microsoft.AspNetCore.Diagnostics
Assembly:
Microsoft.AspNetCore.Diagnostics.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
IExceptionHandler.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Represents an interface for handling exceptions in ASP.NET Core applications. IExceptionHandler implementations are used by the exception handler middleware.

public interface IExceptionHandler
type IExceptionHandler = interface
Public Interface IExceptionHandler

Methods

Name Description
TryHandleAsync(HttpContext, Exception, CancellationToken)

Tries to handle the specified exception asynchronously within the ASP.NET Core pipeline. Implementations of this method can provide custom exception-handling logic for different scenarios.

Applies to


Feedback

Was this page helpful?