Skip to content

Commit

Permalink
Moved exception to ADP
Browse files Browse the repository at this point in the history
IncorrectPhysicalConnectionType exception
  • Loading branch information
DavoudEshtehari committed Jun 7, 2022
1 parent b961662 commit fd380d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected override void CreateSessionHandle(TdsParserStateObject physicalConnect
}
else
{
throw new ArgumentException(StringsHelper.GetString(StringsHelper.SNI_IncorrectPhysicalConnectionType));
throw ADP.IncorrectPhysicalConnectionType();
}
}

Expand Down Expand Up @@ -399,7 +399,5 @@ private SNIHandle GetSessionSNIHandleHandleOrThrow()
[DoesNotReturn]
[MethodImpl(MethodImplOptions.NoInlining)] // this forces the exception throwing code not to be inlined for performance
private void ThrowClosedConnection() => throw ADP.ClosedConnectionError();


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1565,6 +1565,9 @@ internal static ArgumentOutOfRangeException InvalidIsolationLevel(IsolationLevel
return InvalidEnumerationValue(typeof(IsolationLevel), (int)value);
}

// ConnectionUtil
internal static Exception IncorrectPhysicalConnectionType() => new ArgumentException(StringsHelper.GetString(StringsHelper.SNI_IncorrectPhysicalConnectionType));

// IDataParameter.Direction
internal static ArgumentOutOfRangeException InvalidParameterDirection(ParameterDirection value)
{
Expand Down

0 comments on commit fd380d9

Please sign in to comment.