@@ -190,10 +190,6 @@ def _raise_connection_failure(
190
190
) -> NoReturn :
191
191
"""Convert a socket.error to ConnectionFailure and raise it."""
192
192
host , port = address
193
- if isinstance (error , PyMongoError ) and error ._error_labels :
194
- labels = error ._error_labels
195
- else :
196
- labels = None
197
193
# If connecting to a Unix socket, port will be None.
198
194
if port is not None :
199
195
msg = "%s:%d: %s" % (host , port , error )
@@ -204,15 +200,15 @@ def _raise_connection_failure(
204
200
if "configured timeouts" not in msg :
205
201
msg += format_timeout_details (timeout_details )
206
202
if isinstance (error , socket .timeout ):
207
- raise NetworkTimeout (msg , errors = { "errorLabels" : labels } ) from error
203
+ raise NetworkTimeout (msg ) from error
208
204
elif isinstance (error , SSLError ) and "timed out" in str (error ):
209
205
# Eventlet does not distinguish TLS network timeouts from other
210
206
# SSLErrors (https://github.com/eventlet/eventlet/issues/692).
211
207
# Luckily, we can work around this limitation because the phrase
212
208
# '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
214
210
else :
215
- raise AutoReconnect (msg , errors = { "errorLabels" : labels } ) from error
211
+ raise AutoReconnect (msg ) from error
216
212
217
213
218
214
def _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) ->
1424
1420
)
1425
1421
1426
1422
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
+ )
1430
1426
1431
1427
async def _get_conn (
1432
1428
self , checkout_started_time : float , handler : Optional [_MongoClientErrorHandler ] = None
0 commit comments