You can change your method to:
public static bool IsValidEmailDomain(MailAddress address, out Exception exception)
{
exception = null;
....
catch (FormatException ex)
{
exception = ex.ToString();
throw ex;
}
.....
The use the exception in the calling function like this:
public static string test()
{
string mail = "########";
string error = "notValid";
Exception exception = null;
if (IsValidEmailDomain(mail, out exception))
{
return mail;
}
else
{
exception.ToString();
}
}