event EventHandler<ExceptionCaughtEventArgs> OnCaughtExceptiont
The event handler receives an argument of type ExceptionCaughtEventArgs containing data related to this event. The following ExceptionCaughtEventArgs properties provide information specific to this event.
Property | Description |
---|---|
ExceptionHandled | Gets or sets a value indicating whether [exception handled]. |
ExceptionModel | Gets the exception model. |
Model | The object passed as model to the view rendered with the exception if populated or the view had a model |
Page | Gets the page. |
RedirectToAction | Gets the redirect to action. |
RedirectToController | Gets the redirect to controller. |
TransferModelInRoutDictionary | Gets a value indicating whether to transfer model in rout dictionary (only simple models supported work). |
A popular way to hack a site is to crash it to bring it down or to see what happens. This event allows you to except the exception and manage how to deal with it as well as access the page request and generate a blocking incident IPageRequest.RenderThenBlock or IPageRequest.Block on details how to do this.
A positive side effect is that you are able to intercept exceptions and deal with them as they happen without spoiling the users experience
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2