Closed charleschen closed 8 years ago
dispatch function breaks when number of retries is greater than self.max_retries:
def dispatch(self, method_name, endpoint, data=None): method = getattr(self.requests, method_name) retries = 0 while True and retries < self.max_retries: try: response = method(...) break except requests.exceptions.ConnectionError: time.sleep(2) retries += 1 if self.async: return response else: if response.ok: return response.json() else: raise APIError(response.text)
since there's ConnectionError, response is never defined.
submitted pull-request: https://github.com/closeio/closeio-api/pull/51
merged
dispatch function breaks when number of retries is greater than self.max_retries:
since there's ConnectionError, response is never defined.