1.

How do you manage unhandled exceptions in the Action method?

Answer»

The HandleError attribute is used to manage the UNHANDLED exceptions in the action method of the ASP.NET MVC application. CONSIDER that the HandleError is not used in the application, and in CASE an unhandled EXCEPTION is thrown by an action method then the default error page with sensitive information will be displayed to everybody.

It requires enabling custom errors in the web.config FILE, before the usage of HandleError.

<system.web> <customErrors mode="On" defaultRedirect="Error" /></system.web>

Few properties of HandleError can be used for handling the exception. They are:

  • ExceptionType
  • Master
  • View
  • Order.


Discussion

No Comment Found