Class HandleErrorAttribute
Represents an attribute that is used to handle an exception that is thrown by an action method.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, Inherited = true, AllowMultiple = true)]
public class HandleErrorAttribute : FilterAttribute, IMvcFilter, IExceptionFilter
- Inheritance
-
HandleErrorAttribute
- Implements
- Inherited Members
Constructors
HandleErrorAttribute()
Initializes a new instance of the HandleErrorAttribute class.
public HandleErrorAttribute()
Properties
ExceptionType
Gets or sets the type of the exception.
public Type ExceptionType { get; set; }
Property Value
- Type
The type of the exception.
Master
Gets or sets the master view for displaying exception information.
public string Master { get; set; }
Property Value
- string
The master view.
TypeId
Gets the unique identifier for this attribute.
public override object TypeId { get; }
Property Value
- object
The unique identifier for this attribute.
View
Gets or sets the page view for displaying exception information.
public string View { get; set; }
Property Value
- string
The page view.
Methods
OnException(ExceptionContext)
Called when an exception occurs.
public virtual void OnException(ExceptionContext filterContext)
Parameters
filterContext
ExceptionContextThe action-filter context.
Exceptions
- ArgumentNullException
The
filterContext
parameter is null.