private static string BuildExceptionString( Exception exception )
{
string errMessage = string.Empty;
errMessage += exception.Message + Environment.NewLine + exception.StackTrace;
while ( exception.InnerException != null )
{
errMessage += BuildInnerExceptionString( exception.InnerException );
exception = exception.InnerException;
}
return errMessage;
}