ExceptionHandlerExtensions.UseExceptionHandler 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
UseExceptionHandler(IApplicationBuilder) |
将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。 |
UseExceptionHandler(IApplicationBuilder, ExceptionHandlerOptions) |
将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。 |
UseExceptionHandler(IApplicationBuilder, Action<IApplicationBuilder>) |
将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。 |
UseExceptionHandler(IApplicationBuilder, String) |
将中间件添加到管道中,该中间件将捕获异常、记录异常、重置请求路径,然后重新执行请求。 如果响应已启动,则不会重新执行请求。 |
UseExceptionHandler(IApplicationBuilder, String, Boolean) |
将中间件添加到管道中,该中间件将捕获异常、记录异常、重置请求路径,然后重新执行请求。 如果响应已启动,则不会重新执行请求。 |
UseExceptionHandler(IApplicationBuilder)
将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。
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)
将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。
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
参数
- options
- ExceptionHandlerOptions
返回
适用于
UseExceptionHandler(IApplicationBuilder, Action<IApplicationBuilder>)
将中间件添加到管道中,该中间件将捕获异常、记录异常,并在备用管道中重新执行请求。 如果响应已启动,则不会重新执行请求。
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
参数
- configure
- Action<IApplicationBuilder>
返回
适用于
UseExceptionHandler(IApplicationBuilder, String)
将中间件添加到管道中,该中间件将捕获异常、记录异常、重置请求路径,然后重新执行请求。 如果响应已启动,则不会重新执行请求。
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)
将中间件添加到管道中,该中间件将捕获异常、记录异常、重置请求路径,然后重新执行请求。 如果响应已启动,则不会重新执行请求。
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
参数
- createScopeForErrors
- Boolean
是否创建新 IServiceProvider 范围。