Share via


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.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseExceptionHandler(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseExceptionHandler : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseExceptionHandler (app As IApplicationBuilder) As IApplicationBuilder

Parameters

Returns

Applies to

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.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseExceptionHandler(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Microsoft::AspNetCore::Builder::ExceptionHandlerOptions ^ options);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Microsoft.AspNetCore.Builder.ExceptionHandlerOptions options);
static member UseExceptionHandler : Microsoft.AspNetCore.Builder.IApplicationBuilder * Microsoft.AspNetCore.Builder.ExceptionHandlerOptions -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseExceptionHandler (app As IApplicationBuilder, options As ExceptionHandlerOptions) As IApplicationBuilder

Parameters

Returns

Applies to

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.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseExceptionHandler(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, Action<Microsoft::AspNetCore::Builder::IApplicationBuilder ^> ^ configure);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> configure);
static member UseExceptionHandler : Microsoft.AspNetCore.Builder.IApplicationBuilder * Action<Microsoft.AspNetCore.Builder.IApplicationBuilder> -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseExceptionHandler (app As IApplicationBuilder, configure As Action(Of IApplicationBuilder)) As IApplicationBuilder

Parameters

Returns

Applies to

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.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseExceptionHandler(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app, System::String ^ errorHandlingPath);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, string errorHandlingPath);
static member UseExceptionHandler : Microsoft.AspNetCore.Builder.IApplicationBuilder * string -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseExceptionHandler (app As IApplicationBuilder, errorHandlingPath As String) As IApplicationBuilder

Parameters

errorHandlingPath
String

Returns

Applies to

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.

public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseExceptionHandler (this Microsoft.AspNetCore.Builder.IApplicationBuilder app, string errorHandlingPath, bool createScopeForErrors);
static member UseExceptionHandler : Microsoft.AspNetCore.Builder.IApplicationBuilder * string * bool -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseExceptionHandler (app As IApplicationBuilder, errorHandlingPath As String, createScopeForErrors As Boolean) As IApplicationBuilder

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