From 6e8aeeac1539d64534f462d35027cafe550c26da Mon Sep 17 00:00:00 2001 From: micbou Date: Fri, 27 Jan 2017 03:11:26 +0100 Subject: [PATCH] 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. --- python/ycm/client/base_request.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ycm/client/base_request.py b/python/ycm/client/base_request.py index 667a402a..1bde07c8 100644 --- a/python/ycm/client/base_request.py +++ b/python/ycm/client/base_request.py @@ -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.