I am maintaining an Asp.net web application. Instead of using try catch blocks in the C# code to wrap specific C# logic they put this exception handling code in the global.asax file.
Exception exception = server.GetLastError();
if(exception != null)
exception = exception.GetBaseException()
if(exception ! = null)
zError.InnerHtml = exception.Message();
// Code not shown here but write the error message to the exception log.
In my mind this seems a little less effective than using try catch blocks throughout the code in order to target a specific exception. Like for example suppose a SQLException occured. My thinking is that the above code would not log this as a sqlException, but as some more general type of exception. Am I correct in my thinking? What do other Experts thing about this?