Commits

Stefan Scherfke committed 607804d

Check for erros in JSON-response

Comments (0)

Files changed (1)

     try:
         params = urllib.urlencode(chart.params)
         data = json.loads(urllib.urlopen(URL + params).read())
+        
+        if 'error' in data:
+            raise RuntimeError(str(data))
+        
         data = chart.get_data(data)
         if not data:
             raise IOError('No artists found.')