port sweep retry change from CLI (from tom)
@@ -1058,7 +1058,7 @@ class Api(object):
def no_retry_4xx(e):
if not isinstance(e, requests.HTTPError):
return True
- if not(e.response.status_code >= 400 and e.response.status_code < 500):
+ if not(e.response.status_code >= 400 and e.response.status_code < 500) or e.response.status_code == 429:
return True
body = json.loads(e.response.content)
raise UsageError(body['errors'][0]['message'])
@@ -1164,7 +1164,7 @@ class Api(object):
def no_retry_4xx(e):
if not isinstance(e, requests.HTTPError):
return True
- if not(e.response.status_code >= 400 and e.response.status_code < 500):
+ if not(e.response.status_code >= 400 and e.response.status_code < 500) or e.response.status_code == 429:
return True
body = json.loads(e.response.content)
raise UsageError(body['errors'][0]['message'])
