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