Commits

Stefan Scherfke  committed 607804d

Check for erros in JSON-response

  • Participants
  • Parent commits f4365b3

Comments (0)

Files changed (1)

File lastfm/views.py

     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.')