What I am trying to accomplish is catch an exception by the actual method that's being called. This is what I got so far, but what I found out is its only catching the exception by the namespace.
public static void ExceptionHandler(Exception ex)
{
if (ex.Source.Contains("Service"))
{
Console.WriteLine("***Warning: " + ex.Message + " Source: " + ex.Source);
}
if (ex.Source.Contains("SetServiceController"))
{
Console.WriteLine("***Error: " + ex.Message + " Source: " + ex.Source);
}
Console.WriteLine("Error: " + ex.Message + " Source: " + ex.Source);
}
Catching Exception by Source
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Jan 23, 2015, 3:55 AM EST
https://msdn.microsoft.com/en-us/library/system.exception.stacktrace%28v=vs.110%29.aspx
Marc176 reputationPosted Jan 23, 2015, 4:19 AM EST