Skip to content

Commit 79703ec

Browse files
committed
Apply suggested changes
1 parent b77ddb8 commit 79703ec

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniError.netcore.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public SniError(SniProviders provider, uint sniErrorCode, Exception sniException
4242
lineNumber = 0;
4343
function = string.Empty;
4444
this.provider = provider;
45+
nativeError = nativeErrorCode;
4546
if (nativeErrorCode == 0)
4647
{
47-
nativeError = nativeErrorCode;
4848
if (sniException is SocketException socketException)
4949
{
5050
// SocketErrorCode values are cross-plat consistent in .NET (matching native Windows error codes)
@@ -55,10 +55,6 @@ public SniError(SniProviders provider, uint sniErrorCode, Exception sniException
5555
nativeError = (uint)win32Exception.NativeErrorCode; // Replicates native SNI behavior
5656
}
5757
}
58-
else
59-
{
60-
nativeError = nativeErrorCode;
61-
}
6258
sniError = sniErrorCode;
6359
errorMessage = string.Empty;
6460
exception = sniException;

0 commit comments

Comments
 (0)