ExceptionFilterAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
在動作擲回 Exception 之後以非同步方式執行的抽象篩選。 子類別必須覆寫 或 , OnExceptionAsync(ExceptionContext) 但不能同時覆寫 OnException(ExceptionContext) 兩者。
public ref class ExceptionFilterAttribute abstract : Attribute, Microsoft::AspNetCore::Mvc::Filters::IAsyncExceptionFilter, Microsoft::AspNetCore::Mvc::Filters::IExceptionFilter, Microsoft::AspNetCore::Mvc::Filters::IOrderedFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public abstract class ExceptionFilterAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IAsyncExceptionFilter, Microsoft.AspNetCore.Mvc.Filters.IExceptionFilter, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type ExceptionFilterAttribute = class
inherit Attribute
interface IAsyncExceptionFilter
interface IFilterMetadata
interface IExceptionFilter
interface IOrderedFilter
Public MustInherit Class ExceptionFilterAttribute
Inherits Attribute
Implements IAsyncExceptionFilter, IExceptionFilter, IOrderedFilter
- 繼承
-
ExceptionFilterAttribute
- 屬性
- 實作
建構函式
ExceptionFilterAttribute() |
在動作擲回 Exception 之後以非同步方式執行的抽象篩選。 子類別必須覆寫 或 , OnExceptionAsync(ExceptionContext) 但不能同時覆寫 OnException(ExceptionContext) 兩者。 |
屬性
Order |
取得決定篩選準則執行順序的順序值。 篩選會以屬性的 Order 遞增數值執行。 |
方法
OnException(ExceptionContext) |
在動作擲回 之後呼叫 Exception 。 |
OnExceptionAsync(ExceptionContext) |
在動作擲回 之後呼叫 Exception 。 |
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應