We want to handle 403 errors, 404 errors, all errors due to a MySpecialDomainException and provide a default error page for all other errors (including errors i
Better way of handling error is extending handleerror attribute. Handle error attribute has following advantages
With HandleErrorAttribute we get more control over exception handling. HandleError allow us to handle error differently for different controllers and actions easily where in Application_Error to get this feature we take the help of switch loop.
Once you are into Application_Error you are out of MVC and you will lose ControllerContext and then we cannot do much things which will easily possible with HandleError.
see the following post for how to extend error handling attribute and advantages
Advantages of [HandleError] over Application_Error
http://maheshde.blogspot.com.au/2012/09/error-handing-with-mvc-using-custom.html
http://www.codeproject.com/Articles/731913/Exception-Handling-in-MVC