Catch ConnectionError instead of ConnectTimeout

On non-Windows platforms, a ConnectionError exception is raised instead
of a ConnectTimeout one when the connection cannot be established (e.g.
the server crashed). Since the latter is a subclass of the former, we
only need to catch ConnectionError.
This commit is contained in:
micbou 2017-01-27 03:11:26 +01:00
parent dc44597674
commit 6e8aeeac15
No known key found for this signature in database
GPG Key ID: C7E8FD1F3BDA1E05

View File

@ -223,7 +223,7 @@ def HandleServerException( display = True, truncate = False ):
_LoadExtraConfFile( e.extra_conf_file )
else:
_IgnoreExtraConfFile( e.extra_conf_file )
except requests.exceptions.ConnectTimeout:
except requests.exceptions.ConnectionError:
# We don't display this exception to the user since it is likely to happen
# for each subsequent request (typically if the server crashed) and we
# don't want to spam the user with it.