@@ -190,10 +190,6 @@ def _raise_connection_failure(
190190) -> NoReturn :
191191 """Convert a socket.error to ConnectionFailure and raise it."""
192192 host , port = address
193- if isinstance (error , PyMongoError ) and error ._error_labels :
194- labels = error ._error_labels
195- else :
196- labels = None
197193 # If connecting to a Unix socket, port will be None.
198194 if port is not None :
199195 msg = "%s:%d: %s" % (host , port , error )
@@ -204,15 +200,15 @@ def _raise_connection_failure(
204200 if "configured timeouts" not in msg :
205201 msg += format_timeout_details (timeout_details )
206202 if isinstance (error , socket .timeout ):
207- raise NetworkTimeout (msg , errors = { "errorLabels" : labels } ) from error
203+ raise NetworkTimeout (msg ) from error
208204 elif isinstance (error , SSLError ) and "timed out" in str (error ):
209205 # Eventlet does not distinguish TLS network timeouts from other
210206 # SSLErrors (https://github.com/eventlet/eventlet/issues/692).
211207 # Luckily, we can work around this limitation because the phrase
212208 # 'timed out' appears in all the timeout related SSLErrors raised.
213- raise NetworkTimeout (msg , errors = { "errorLabels" : labels } ) from error
209+ raise NetworkTimeout (msg ) from error
214210 else :
215- raise AutoReconnect (msg , errors = { "errorLabels" : labels } ) from error
211+ raise AutoReconnect (msg ) from error
216212
217213
218214def _get_timeout_details (options : PoolOptions ) -> dict [str , float ]:
@@ -1424,9 +1420,9 @@ def _raise_if_not_ready(self, checkout_started_time: float, emit_event: bool) ->
14241420 )
14251421
14261422 details = _get_timeout_details (self .opts )
1427- error = AutoReconnect ( "connection pool paused" )
1428- error . _add_error_label ( "TransientTransactionError" )
1429- _raise_connection_failure ( self . address , error , timeout_details = details )
1423+ _raise_connection_failure (
1424+ self . address , AutoReconnect ( "connection pool paused" ), timeout_details = details
1425+ )
14301426
14311427 async def _get_conn (
14321428 self , checkout_started_time : float , handler : Optional [_MongoClientErrorHandler ] = None
0 commit comments