Skip to content

Commit 277e181

Browse files
committed
Clean up wrapped exceptions. Fix param nullability.
1 parent 6ee2218 commit 277e181

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/ChannelDbConnectionPool.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public DbConnectionInternal ReplaceConnection(
151151
}
152152

153153
/// <inheritdoc />
154-
public void ReturnInternalConnection(DbConnectionInternal connection, DbConnection? owningObject)
154+
public void ReturnInternalConnection(DbConnectionInternal connection, DbConnection owningObject)
155155
{
156156
ValidateOwnershipAndSetPoolingState(connection, owningObject);
157157

@@ -545,13 +545,13 @@ private void PrepareConnection(DbConnection owningObject, DbConnectionInternal c
545545
//TODO: pass through transaction
546546
connection.ActivateConnection(null);
547547
}
548-
catch (Exception e)
548+
catch
549549
{
550550
// At this point, the connection is "out of the pool" (the call to postpop). If we hit a transient
551551
// error anywhere along the way when enlisting the connection in the transaction, we need to get
552552
// the connection back into the pool so that it isn't leaked.
553553
ReturnInternalConnection(connection, owningObject);
554-
throw new Exception("Failed to activate connection", e);
554+
throw;
555555
}
556556
}
557557

src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/ConnectionPoolSlots.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ internal ConnectionPoolSlots(uint fixedCapacity)
141141
catch (Exception e)
142142
{
143143
cleanupCallback(connection, cleanupState);
144-
throw new Exception("Failed to create or add connection", e);
144+
throw;
145145
}
146146
}
147147

0 commit comments

Comments
 (0)