Skip to content

Flatwhite.ExceptionFilterAttribute

Van Nguyen edited this page Dec 6, 2015 · 1 revision

Similar to MethodFilterAttribute, you can implement ExceptionFilterAttribute to provide custom error handling logic. If the property MethodExceptionContext.Handled is true, all remaining ExceptionFilter will be ignored.

public abstract class ExceptionFilterAttribute : Attribute
{    
    public virtual void OnException(MethodExceptionContext exceptionContext);    
    public virtual Task OnExceptionAsync(MethodExceptionContext exceptionContext);       
}

Similar to MethodFilterAttribute, the OnExceptionAsync method will be called only the decorated method is async.

Clone this wiki locally