-
-
Save explorer14/d6a2e67e92056120f80688ad0571ef6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class MySqlExceptionExtensions | |
{ | |
public static bool IsFailoverException(this MySqlException mySqlException) | |
{ | |
return mySqlException.Number == (int)MySqlErrorCode.UnableToConnectToHost || | |
mySqlException.Number == (int)MySqlErrorCode.OptionPreventsStatement || | |
(mySqlException.Number == 0 && mySqlException.HResult == -2147467259); | |
// Fatal error reading from the stream, usually Number being 0 means host connection issues | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment