Explanation/Reference:
Explanation:
Enabling Custom Error Handling
To enable custom error handling for use by a HandleErrorAttribute filter, add a customErrors element to the system.web section of the application's Web.config file, as shown in the following example:
<system.web>
<customErrors mode="On" defaultRedirect="Error" />
</system.web>
Note:
The HandleErrorAttribute attribute in ASP.NET MVC lets you specify how to handle an exception that is thrown by an action method. By default, when an action method with theHandleErrorAttribute attribute throws any exception, MVC displays the Error view that is located in the ~/Views/Shared folder.
Setting HandleErrorAttribute Properties
You can modify the default behavior of the HandleErrorAttribute filter by setting the following properties:
ExceptionType. Specifies the exception type or types that the filter will handle. If this property is not

specified, the filter handles all exceptions.
View. Specifies the name of the view to display.

Master. Specifies the name of the master view to use, if any.

Order. Specifies the order in which the filters are applied, if more than one HandleErrorAttribute filter is

possible for a method.
References: https://msdn.microsoft.com/en-us/library/system.web.mvc.handleerrorattribute(v=vs.118).aspx