data = gzipper.read()
else:
data = response.read()
- return json.loads(data)
+ the_data = json.loads(data)
+ if 'error' in the_data.keys():
+ raise APIError(the_data['error']['info'])
+ return
def limits(self, low, high):
if self._high_limits == None:
return low
+class APIError(Exception):
+
+ def __init__(self, info):
+ self.info = info
+
+ def __str__(self):
+ return self.info
+
+
def pagename_to_filename(name):
name = name.replace(' ', '_')
name = name.replace('/', '!')