System.Data.SqlClient.SqlExceptionExtensions.IsConnectionError C# (CSharp) Method

IsConnectionError() public static method

Determines whether the specified exception represents a connection error.
public static IsConnectionError ( this exception ) : bool
exception this The exception.
return bool
        public static bool IsConnectionError(this SqlException exception)
        {
            Contract.Requires(exception != null);

            return IsNamedPipeConnectionError(exception) ||
                   IsTcpIpConnectionError(exception);
        }