commit:     25535069d5943b6e7bbbe4607e40685a7ed36ea4
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue May 31 01:32:43 2022 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue May 31 02:21:52 2022 +0000
URL:        https://gitweb.gentoo.org/proj/mirrorselect.git/commit/?id=25535069

selectors.py: Bug 800149. Add general exception for any other server error

Catch any other server errors so that mirrorselect will ignore that
server without crashing.
It will also output the error and request it to be reported.

Signed-off-by: Brian Dolbec <dolsen <AT> gentoo.org>

 mirrorselect/selectors.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py
index 74405a7..35051ee 100644
--- a/mirrorselect/selectors.py
+++ b/mirrorselect/selectors.py
@@ -460,6 +460,11 @@ class Deep(object):
                except TimeoutException:
                        self.output.write(('deeptime(): connection to host %s '
                                'timed out for ip %s\n') % (url_parts.hostname, 
ip), 2)
+               except Exception as e:   # Add general exception to catch any 
other errors
+                       self.output.write(('deeptime(): connection to host %s '
+                               'errored for ip %s\n            %s\n'
+                               '          Please file a bug for this error at 
bugs.gentoo.org')
+                               % (url_parts.hostname, ip, e), 2)
                return f, test_url, early_out
 
 

Reply via email to