File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 5757 OperationFailure ,
5858 PyMongoError ,
5959 WaitQueueTimeoutError ,
60+ _CertificateError ,
6061)
6162from pymongo .hello import Hello , HelloCompat
6263from pymongo .helpers_shared import _get_timeout_details , format_timeout_details
@@ -1029,6 +1030,9 @@ def _handle_connection_error(self, error: BaseException) -> None:
10291030 if self .is_sdam or type (error ) not in (AutoReconnect , NetworkTimeout ):
10301031 return
10311032 assert isinstance (error , AutoReconnect ) # Appease type checker.
1033+ # If the original error was a certificate or SSL error, ignore it.
1034+ if isinstance (error .__cause__ , (_CertificateError , SSLErrors )):
1035+ return
10321036 error ._add_error_label ("SystemOverloadedError" )
10331037 error ._add_error_label ("RetryableError" )
10341038
Original file line number Diff line number Diff line change 5454 OperationFailure ,
5555 PyMongoError ,
5656 WaitQueueTimeoutError ,
57+ _CertificateError ,
5758)
5859from pymongo .hello import Hello , HelloCompat
5960from pymongo .helpers_shared import _get_timeout_details , format_timeout_details
@@ -1025,6 +1026,9 @@ def _handle_connection_error(self, error: BaseException) -> None:
10251026 if self .is_sdam or type (error ) not in (AutoReconnect , NetworkTimeout ):
10261027 return
10271028 assert isinstance (error , AutoReconnect ) # Appease type checker.
1029+ # If the original error was a certificate or SSL error, ignore it.
1030+ if isinstance (error .__cause__ , (_CertificateError , SSLErrors )):
1031+ return
10281032 error ._add_error_label ("SystemOverloadedError" )
10291033 error ._add_error_label ("RetryableError" )
10301034
You can’t perform that action at this time.
0 commit comments