Browse Source

cleanup - actually use retries var in APIException

feature/docs
Andrei 8 years ago
parent
commit
e0ea431d9d
  1. 5
      disco/api/http.py

5
disco/api/http.py

@ -143,9 +143,14 @@ class APIException(Exception):
"""
def __init__(self, response, retries=None):
self.response = response
self.retries = retries
self.code = 0
self.msg = 'Request Failed ({})'.format(response.status_code)
if self.retries:
self.msg += " after {} retries".format(self.retries)
# Try to decode JSON, and extract params
try:
data = self.response.json()

Loading…
Cancel
Save