I have a project I am creating and I am adding a reference to a class that generates an email where the exception happened and lots of good stuff.
My question is. If I was to put this in a method and call it in the Catch{} how would i do this for the whole project so i could just name the method in the catch and it would know on every page of the project.
var exceptionUtility = new genericExceptions();
exceptionUtility.genericSystemException(
ex,
Server.MachineName,
Page.TemplateSourceDirectory.Remove(0, 1) + Page.AppRelativeVirtualPath.Remove(0, 1),
ConfigurationManager.AppSettings["emailSupport"],
ConfigurationManager.AppSettings["emailFrom"],
string.Empty);
catch{}I want to make this better.try{}catch{}is low as long as you don't actually throw exceptions.Catch{}and reference it some how in the project and just keep calling the method in theCatch{}