ExceptionHandlerExtensions Class

Namespace
Microsoft.AspNetCore.Builder
Assemblies
  • Microsoft.AspNetCore.Diagnostics

Syntax

public class ExceptionHandlerExtensions
class Microsoft.AspNetCore.Builder.ExceptionHandlerExtensions

Methods

UseExceptionHandler(Microsoft.AspNetCore.Builder.IApplicationBuilder)

Adds a middleware to the pipeline that will catch exceptions, log them, and re-execute the request in an alternate pipeline. The request will not be re-executed if the response has already started.

Return type:Microsoft.AspNetCore.Builder.IApplicationBuilder
public static IApplicationBuilder UseExceptionHandler(this IApplicationBuilder app)
UseExceptionHandler(Microsoft.AspNetCore.Builder.IApplicationBuilder, Microsoft.AspNetCore.Builder.ExceptionHandlerOptions)

Adds a middleware to the pipeline that will catch exceptions, log them, and re-execute the request in an alternate pipeline. The request will not be re-executed if the response has already started.

Return type:Microsoft.AspNetCore.Builder.IApplicationBuilder
public static IApplicationBuilder UseExceptionHandler(this IApplicationBuilder app, ExceptionHandlerOptions options)
UseExceptionHandler(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.Action<Microsoft.AspNetCore.Builder.IApplicationBuilder>)

Adds a middleware to the pipeline that will catch exceptions, log them, and re-execute the request in an alternate pipeline. The request will not be re-executed if the response has already started.

Return type:Microsoft.AspNetCore.Builder.IApplicationBuilder
public static IApplicationBuilder UseExceptionHandler(this IApplicationBuilder app, Action<IApplicationBuilder> configure)
UseExceptionHandler(Microsoft.AspNetCore.Builder.IApplicationBuilder, System.String)

Adds a middleware to the pipeline that will catch exceptions, log them, reset the request path, and re-execute the request. The request will not be re-executed if the response has already started.

Return type:Microsoft.AspNetCore.Builder.IApplicationBuilder
public static IApplicationBuilder UseExceptionHandler(this IApplicationBuilder app, string errorHandlingPath)