I am using ASP.NET MVC 4
I want to trace or handle Exception globally.
1.Which is handled by user code?
2.Which is not handled by user code?
Shows different ways of handling errors globally. Setting a global exception handling filter is the usual.
You would derive a new Attribute from HandleErrorAttribute and put your logic in there, overriding the OnException method.
public override void OnException(ExceptionContext filterContext)
However this will not show you exceptions that are handled by other code. That is the point, they are handled so they do not continue to bubble up the stack. You would have to put code in each of those catch blocks to either do what you want.