ExceptionHandlerExtensions.UseExceptionHandler 方法

定义

重载

UseExceptionHandler(IApplicationBuilder)

将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。

UseExceptionHandler(IApplicationBuilder, ExceptionHandlerOptions)

将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。

UseExceptionHandler(IApplicationBuilder, Action<IApplicationBuilder>)

将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。

UseExceptionHandler(IApplicationBuilder, String)

将中间件添加到管道中,该中间件将捕获异常、记录异常、重置请求路径,然后重新执行请求。 如果响应已启动,则不会重新执行请求。

UseExceptionHandler(IApplicationBuilder, String, Boolean)

将中间件添加到管道中,该中间件将捕获异常、记录异常、重置请求路径,然后重新执行请求。 如果响应已启动,则不会重新执行请求。

UseExceptionHandler(IApplicationBuilder)

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

将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。

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

参数

返回

适用于

UseExceptionHandler(IApplicationBuilder, ExceptionHandlerOptions)

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

将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。

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

参数

返回

适用于

UseExceptionHandler(IApplicationBuilder, Action<IApplicationBuilder>)

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

将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。

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

参数

返回

适用于

UseExceptionHandler(IApplicationBuilder, String)

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

将中间件添加到管道中,该中间件将捕获异常、记录异常、重置请求路径,然后重新执行请求。 如果响应已启动,则不会重新执行请求。

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

参数

errorHandlingPath
String

返回

适用于

UseExceptionHandler(IApplicationBuilder, String, Boolean)

Source:
ExceptionHandlerExtensions.cs

将中间件添加到管道中,该中间件将捕获异常、记录异常、重置请求路径,然后重新执行请求。 如果响应已启动,则不会重新执行请求。

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

参数

errorHandlingPath
String

String 处理异常的终结点的路径。

createScopeForErrors
Boolean

是否创建新 IServiceProvider 范围。

返回

适用于