api: Distinguish Requests connection errors from server 500s.
(imported from commit 1879ea4030c2441c049d9c68684b33a1d2444572)
This commit is contained in:
parent
35fbf350ae
commit
2b0ca01cdb
|
@ -36,7 +36,7 @@ class HumbugAPI():
|
||||||
if str(res.status_code).startswith('5') and self.retry_on_errors:
|
if str(res.status_code).startswith('5') and self.retry_on_errors:
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
if not had_error_retry:
|
if not had_error_retry:
|
||||||
sys.stdout.write("connection error -- retrying.")
|
sys.stdout.write("connection error %s -- retrying." % (res.status_code,))
|
||||||
had_error_retry = True
|
had_error_retry = True
|
||||||
request["failures"] += 1
|
request["failures"] += 1
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue