private static bool IsConnectivityFailureException(Exception e, string Description)
{
//
// This is a giant hack. Unfortunately the MySQL library doesn't
// seem to expose any real indication of whether a failure was due
// to a connectivity related issue or some unrelated cause (such as
// a server-side processing error).
//
// Hence, English-language parse.
//
if (Description.Contains("Unable to connect to any of the specified MySQL hosts.") ||
Description.Contains("A connection attempt failed") ||
Description.Contains("Timeout in IO operation"))
{
return true;
}
else
{
return false;
}
}