One simple solution would be to extract the duplicate code in your own method, for example:
public static void ReportError(Exception exceptionRaised, string reference, string customMessage, bool sendEmail)
{
ProcessError(Message, SendEmail)
}
public static void ReportError(string errorMessage, string reference, bool sendEmail)
{
ProcessError(Message, SendEmail)
}
private static void ProcessError(string message, bool sendEmail)
{
}
This, of course, is not the most elegant way to do this, but it is a beginning; -)
source
share