Op Englesch liesen

Deelen iwwer


ExceptionHandlerExtensions.UseExceptionHandler Method

Definition

Overloads

UseExceptionHandler(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.

UseExceptionHandler(IApplicationBuilder, 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.

UseExceptionHandler(IApplicationBuilder, Action<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.

UseExceptionHandler(IApplicationBuilder, 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.

UseExceptionHandler(IApplicationBuilder, String, Boolean)

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.

UseExceptionHandler(IApplicationBuilder)

Source:
ExceptionHandlerExtensions.cs
Source:
ExceptionHandlerExtensions.cs
Source:
ExceptionHandlerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);

Parameters

Returns

Applies to

ASP.NET Core 9.0 an aner Versiounen
Produkt Versiounen
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

UseExceptionHandler(IApplicationBuilder, ExceptionHandlerOptions)

Source:
ExceptionHandlerExtensions.cs
Source:
ExceptionHandlerExtensions.cs
Source:
ExceptionHandlerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Builder.ExceptionHandlerOptions options);

Parameters

Returns

Applies to

ASP.NET Core 9.0 an aner Versiounen
Produkt Versiounen
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

UseExceptionHandler(IApplicationBuilder, Action<IApplicationBuilder>)

Source:
ExceptionHandlerExtensions.cs
Source:
ExceptionHandlerExtensions.cs
Source:
ExceptionHandlerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> configure);

Parameters

Returns

Applies to

ASP.NET Core 9.0 an aner Versiounen
Produkt Versiounen
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

UseExceptionHandler(IApplicationBuilder, String)

Source:
ExceptionHandlerExtensions.cs
Source:
ExceptionHandlerExtensions.cs
Source:
ExceptionHandlerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, string errorHandlingPath);

Parameters

errorHandlingPath
String

Returns

Applies to

ASP.NET Core 9.0 an aner Versiounen
Produkt Versiounen
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

UseExceptionHandler(IApplicationBuilder, String, Boolean)

Source:
ExceptionHandlerExtensions.cs

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.

C#
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, string errorHandlingPath, bool createScopeForErrors);

Parameters

errorHandlingPath
String

The String path to the endpoint that will handle the exception.

createScopeForErrors
Boolean

Whether or not to create a new IServiceProvider scope.

Returns

Applies to

ASP.NET Core 9.0 a ASP.NET Core 8.0
Produkt Versiounen
ASP.NET Core 8.0, 9.0