log error response when fail to check wakatime-cli version or download binary

This commit is contained in:
Alan Hamlett 2021-11-01 17:27:12 -07:00
parent 389c84673e
commit 650bb6fa26

View File

@ -843,12 +843,15 @@ def request(url, last_modified=None):
resp = urlopen(url) resp = urlopen(url)
headers = dict(resp.getheaders()) if is_py2 else resp.headers headers = dict(resp.getheaders()) if is_py2 else resp.headers
return headers, resp.read(), resp.getcode() return headers, resp.read(), resp.getcode()
except HTTPError as err: except HTTPError as err2:
if err.code == 304: if err2.code == 304:
return None, None, 304 return None, None, 304
log(DEBUG, err.read().decode())
log(DEBUG, err2.read().decode())
raise raise
except IOError: except IOError:
raise raise
log(DEBUG, err.read().decode())
raise raise
except IOError: except IOError:
if is_py2: if is_py2:
@ -860,6 +863,7 @@ def request(url, last_modified=None):
except HTTPError as err: except HTTPError as err:
if err.code == 304: if err.code == 304:
return None, None, 304 return None, None, 304
log(DEBUG, err.read().decode())
raise raise
except IOError: except IOError:
raise raise